diff --git a/.gitignore b/.gitignore index 54b212c74d..5be4d3cb0b 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,5 @@ __image_snapshots__/ /jest-stare /imageSnapshots /imageDiffSnapshots + +.devcontainer* diff --git a/components/__tests__/__snapshots__/index.test.js.snap b/components/__tests__/__snapshots__/index.test.js.snap index 194d145727..3e17f31437 100644 --- a/components/__tests__/__snapshots__/index.test.js.snap +++ b/components/__tests__/__snapshots__/index.test.js.snap @@ -45,6 +45,7 @@ Array [ "Rate", "Result", "Row", + "Segmented", "Select", "Skeleton", "Slider", diff --git a/components/index.tsx b/components/index.tsx index 88b07ad7ae..3915e62f22 100644 --- a/components/index.tsx +++ b/components/index.tsx @@ -154,6 +154,9 @@ export { default as Row } from './row'; export type { SelectProps } from './select'; export { default as Select } from './select'; +export type { SegmentedProps } from './segmented'; +export { default as Segmented } from './segmented'; + export type { SkeletonProps } from './skeleton'; export { default as Skeleton } from './skeleton'; diff --git a/components/segmented/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/segmented/__tests__/__snapshots__/demo-extend.test.ts.snap new file mode 100644 index 0000000000..d2102e19fa --- /dev/null +++ b/components/segmented/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -0,0 +1,861 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders ./components/segmented/demo/basic.md extend context correctly 1`] = ` +
+ + + + + +
+`; + +exports[`renders ./components/segmented/demo/block.md extend context correctly 1`] = ` +
+ + + +
+`; + +exports[`renders ./components/segmented/demo/controlled.md extend context correctly 1`] = ` +
+ + + +
+`; + +exports[`renders ./components/segmented/demo/custom.md extend context correctly 1`] = ` +Array [ +
+ + + +
, +
, +
+ + + + +
, +] +`; + +exports[`renders ./components/segmented/demo/disabled.md extend context correctly 1`] = ` +Array [ +
+ + + +
, +
, +
+ + + + + +
, +] +`; + +exports[`renders ./components/segmented/demo/dynamic.md extend context correctly 1`] = ` +Array [ +
+ + + +
, +
, + , +] +`; + +exports[`renders ./components/segmented/demo/size.md extend context correctly 1`] = ` +Array [ +
+ + + + + +
, +
, +
+ + + + + +
, +
, +
+ + + + + +
, +] +`; + +exports[`renders ./components/segmented/demo/with-icon.md extend context correctly 1`] = ` +
+ + +
+`; diff --git a/components/segmented/__tests__/__snapshots__/demo.test.js.snap b/components/segmented/__tests__/__snapshots__/demo.test.js.snap new file mode 100644 index 0000000000..4d7e4a8add --- /dev/null +++ b/components/segmented/__tests__/__snapshots__/demo.test.js.snap @@ -0,0 +1,861 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders ./components/segmented/demo/basic.md correctly 1`] = ` +
+ + + + + +
+`; + +exports[`renders ./components/segmented/demo/block.md correctly 1`] = ` +
+ + + +
+`; + +exports[`renders ./components/segmented/demo/controlled.md correctly 1`] = ` +
+ + + +
+`; + +exports[`renders ./components/segmented/demo/custom.md correctly 1`] = ` +Array [ +
+ + + +
, +
, +
+ + + + +
, +] +`; + +exports[`renders ./components/segmented/demo/disabled.md correctly 1`] = ` +Array [ +
+ + + +
, +
, +
+ + + + + +
, +] +`; + +exports[`renders ./components/segmented/demo/dynamic.md correctly 1`] = ` +Array [ +
+ + + +
, +
, + , +] +`; + +exports[`renders ./components/segmented/demo/size.md correctly 1`] = ` +Array [ +
+ + + + + +
, +
, +
+ + + + + +
, +
, +
+ + + + + +
, +] +`; + +exports[`renders ./components/segmented/demo/with-icon.md correctly 1`] = ` +
+ + +
+`; diff --git a/components/segmented/__tests__/__snapshots__/index.test.tsx.snap b/components/segmented/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..aac71f442c --- /dev/null +++ b/components/segmented/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,638 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Segmented render empty segmented 1`] = ` +
+`; + +exports[`Segmented render label with ReactNode 1`] = ` +
+ + + +
+`; + +exports[`Segmented render segmented ok 1`] = ` +
+ + + +
+`; + +exports[`Segmented render segmented with \`block\` 1`] = ` +
+ + + +
+`; + +exports[`Segmented render segmented with \`size#large\` 1`] = ` +
+ + + +
+`; + +exports[`Segmented render segmented with \`size#small\` 1`] = ` +
+ + + +
+`; + +exports[`Segmented render segmented with mixed options 1`] = ` +
+ + + +
+`; + +exports[`Segmented render segmented with numeric options 1`] = ` +
+ + + + + +
+`; + +exports[`Segmented render segmented with options null/undefined 1`] = ` +
+