@edvisor/product-language 0.9.0 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +12 -0
- package/.eslintrc.json +147 -0
- package/.release-it.json +17 -0
- package/.storybook/main.js +57 -0
- package/.storybook/manager.js +7 -0
- package/.storybook/preview.js +15 -0
- package/.storybook/tsconfig.json +30 -0
- package/jest.config.ts +15 -0
- package/jest.setup.ts +2 -0
- package/package.json +2 -27
- package/project.json +98 -0
- package/src/README.md +61 -0
- package/src/assets/svg/example_icon.svg +3 -0
- package/src/assets/svg/example_icon_white.svg +3 -0
- package/src/assets/svg/spinner.svg +3 -0
- package/src/assets/svg/spinner_white.svg +3 -0
- package/src/helpers/index.ts +4 -0
- package/src/helpers/playground.ts +26 -0
- package/src/helpers/talesOf.tsx +42 -0
- package/src/index.ts +2 -0
- package/src/lib/components/README.md +49 -0
- package/src/lib/components/alert-banner/alert-banner.test.tsx +93 -0
- package/src/lib/components/alert-banner/alert-banner.tsx +117 -0
- package/src/lib/components/alert-banner/alert-level-flags.ts +101 -0
- package/src/lib/components/alert-banner/index.ts +1 -0
- package/src/lib/components/alert-banner/storybook/alert-banner.stories.mdx +67 -0
- package/src/lib/components/alert-banner/storybook/components.tsx +124 -0
- package/src/lib/components/badge/badge-type-flags.ts +72 -0
- package/src/lib/components/badge/badge.test.tsx +29 -0
- package/src/lib/components/badge/badge.tsx +22 -0
- package/src/lib/components/badge/index.ts +1 -0
- package/src/lib/components/badge/stories/badge.stories.mdx +44 -0
- package/src/lib/components/badge/stories/components.tsx +49 -0
- package/{lib/components/card/atoms/card-frame.d.ts → src/lib/components/card/atoms/card-frame.tsx} +16 -7
- package/src/lib/components/card/atoms/index.ts +1 -0
- package/src/lib/components/card/card.test.tsx +162 -0
- package/src/lib/components/card/card.tsx +78 -0
- package/src/lib/components/card/components/card-alert-banner-slot.tsx +16 -0
- package/src/lib/components/card/components/card-controls-slot.tsx +19 -0
- package/src/lib/components/card/components/card-section-slot.tsx +51 -0
- package/src/lib/components/card/components/index.ts +3 -0
- package/src/lib/components/card/index.ts +3 -0
- package/src/lib/components/card/molecules/index.ts +1 -0
- package/src/lib/components/card/molecules/left-right-card.test.tsx +89 -0
- package/src/lib/components/card/molecules/left-right-card.tsx +63 -0
- package/src/lib/components/card/storybook/card.stories.mdx +100 -0
- package/src/lib/components/card/storybook/components.tsx +227 -0
- package/src/lib/components/checkbox/checkbox.test.tsx +39 -0
- package/src/lib/components/checkbox/checkbox.tsx +70 -0
- package/src/lib/components/checkbox/helpers.tsx +98 -0
- package/src/lib/components/checkbox/index.tsx +1 -0
- package/src/lib/components/checkbox/stories/checkbox.stories.mdx +57 -0
- package/src/lib/components/checkbox/stories/components.tsx +84 -0
- package/src/lib/components/date-picker/components/custom-calendar.tsx +193 -0
- package/src/lib/components/date-picker/components/index.ts +1 -0
- package/src/lib/components/date-picker/data-picker.test.tsx +220 -0
- package/src/lib/components/date-picker/date-picker.tsx +10 -0
- package/src/lib/components/date-picker/helpers/date-picker-factory.tsx +210 -0
- package/src/lib/components/date-picker/index.ts +1 -0
- package/src/lib/components/date-picker/storybook/components.tsx +259 -0
- package/src/lib/components/date-picker/storybook/date-picker.stories.mdx +133 -0
- package/src/lib/components/divider/divider-type-flags.tsx +37 -0
- package/src/lib/components/divider/divider.test.tsx +34 -0
- package/src/lib/components/divider/divider.tsx +37 -0
- package/src/lib/components/divider/index.tsx +1 -0
- package/src/lib/components/divider/stories/components.tsx +13 -0
- package/src/lib/components/divider/stories/divider.stories.mdx +44 -0
- package/src/lib/components/flag/flag-size-flags.tsx +55 -0
- package/src/lib/components/flag/flag.list.tsx +788 -0
- package/src/lib/components/flag/flag.test.tsx +65 -0
- package/src/lib/components/flag/flag.tsx +97 -0
- package/src/lib/components/flag/index.tsx +1 -0
- package/src/lib/components/flag/stories/components.tsx +403 -0
- package/src/lib/components/flag/stories/flag.stories.mdx +48 -0
- package/src/lib/components/flag/stories/playGround-select.tsx +145 -0
- package/src/lib/components/icon/icon-list.tsx +135 -0
- package/src/lib/components/icon/icon.test.tsx +47 -0
- package/src/lib/components/icon/icon.tsx +181 -0
- package/src/lib/components/icon/index.tsx +1 -0
- package/src/lib/components/icon/stories/components.tsx +282 -0
- package/src/lib/components/icon/stories/icon.stories.mdx +65 -0
- package/src/lib/components/index.ts +26 -0
- package/src/lib/components/input-field/components/index.ts +2 -0
- package/src/lib/components/input-field/components/labeled-input.tsx +57 -0
- package/src/lib/components/input-field/components/stepper.tsx +64 -0
- package/src/lib/components/input-field/index.ts +6 -0
- package/src/lib/components/input-field/input-field.test.tsx +107 -0
- package/src/lib/components/input-field/input-field.tsx +154 -0
- package/src/lib/components/input-field/input-number.tsx +41 -0
- package/src/lib/components/input-field/input-text.tsx +30 -0
- package/src/lib/components/input-field/storybook/components.tsx +367 -0
- package/src/lib/components/input-field/storybook/input-field.stories.mdx +120 -0
- package/src/lib/components/layout/flex.tsx +22 -0
- package/src/lib/components/layout/grid-layout.tsx +40 -0
- package/src/lib/components/layout/index.ts +3 -0
- package/src/lib/components/layout/left-right-layout.tsx +67 -0
- package/src/lib/components/link/index.ts +1 -0
- package/src/lib/components/link/link.test.tsx +29 -0
- package/src/lib/components/link/link.tsx +56 -0
- package/src/lib/components/link/storybook/link.stories.mdx +52 -0
- package/src/lib/components/modal/index.ts +3 -0
- package/src/lib/components/modal/modal-base.tsx +129 -0
- package/src/lib/components/modal/modal-destructive.tsx +70 -0
- package/src/lib/components/modal/modal.test.tsx +138 -0
- package/src/lib/components/modal/modal.tsx +114 -0
- package/src/lib/components/modal/storybook/components.tsx +105 -0
- package/src/lib/components/modal/storybook/modal-destructive.stories.mdx +31 -0
- package/src/lib/components/modal/storybook/modal.stories.mdx +50 -0
- package/src/lib/components/molecules/avatar/avatar-size-flags.tsx +55 -0
- package/src/lib/components/molecules/avatar/avatar.test.tsx +114 -0
- package/src/lib/components/molecules/avatar/avatar.tsx +80 -0
- package/src/lib/components/molecules/avatar/index.tsx +1 -0
- package/src/lib/components/molecules/avatar/stories/avatar.stories.mdx +52 -0
- package/src/lib/components/molecules/avatar/stories/components.tsx +36 -0
- package/src/lib/components/molecules/button/button-flags.tsx +340 -0
- package/src/lib/components/molecules/button/button.test.tsx +77 -0
- package/src/lib/components/molecules/button/button.tsx +212 -0
- package/src/lib/components/molecules/button/index.tsx +1 -0
- package/src/lib/components/molecules/button/stories/button.stories.mdx +105 -0
- package/src/lib/components/molecules/button/stories/components.tsx +90 -0
- package/src/lib/components/molecules/index.ts +3 -0
- package/src/lib/components/molecules/input-checkbox/index.tsx +1 -0
- package/src/lib/components/molecules/input-checkbox/input-checkbox.test.tsx +34 -0
- package/src/lib/components/molecules/input-checkbox/input-checkbox.tsx +50 -0
- package/src/lib/components/molecules/input-checkbox/stories/components.tsx +53 -0
- package/src/lib/components/molecules/input-checkbox/stories/input-checkbox.stories.mdx +49 -0
- package/src/lib/components/organisms/choice-list/choice-list.test.tsx +36 -0
- package/src/lib/components/organisms/choice-list/choice-list.tsx +72 -0
- package/src/lib/components/organisms/choice-list/index.tsx +1 -0
- package/src/lib/components/organisms/choice-list/stories/choice-list.stories.mdx +57 -0
- package/src/lib/components/organisms/choice-list/stories/components.tsx +45 -0
- package/src/lib/components/organisms/index.ts +2 -0
- package/src/lib/components/organisms/multi-choice-list/index.tsx +1 -0
- package/src/lib/components/organisms/multi-choice-list/multi-choice-list.test.tsx +33 -0
- package/src/lib/components/organisms/multi-choice-list/multi-choice-list.tsx +53 -0
- package/src/lib/components/organisms/multi-choice-list/stories/components.tsx +124 -0
- package/src/lib/components/organisms/multi-choice-list/stories/multi-choice-list.stories.mdx +99 -0
- package/src/lib/components/progress-bar/index.ts +1 -0
- package/src/lib/components/progress-bar/progress-bar-size-flags.tsx +37 -0
- package/src/lib/components/progress-bar/progress-bar.test.tsx +66 -0
- package/src/lib/components/progress-bar/progress-bar.tsx +42 -0
- package/src/lib/components/progress-bar/storybook/components.tsx +62 -0
- package/src/lib/components/progress-bar/storybook/progress-bar.stories.mdx +43 -0
- package/{lib/components/spinner/index.d.ts → src/lib/components/radio-button/index.tsx} +1 -1
- package/src/lib/components/radio-button/radio-button.tsx +135 -0
- package/src/lib/components/radio-button/radio.test.tsx +59 -0
- package/src/lib/components/radio-button/stories/components.tsx +36 -0
- package/src/lib/components/radio-button/stories/radio-button.stories.mdx +44 -0
- package/src/lib/components/range-slider/components/bar-chart.tsx +50 -0
- package/src/lib/components/range-slider/components/handle.tsx +58 -0
- package/src/lib/components/range-slider/components/rail.tsx +44 -0
- package/src/lib/components/range-slider/components/slider-component.tsx +98 -0
- package/src/lib/components/range-slider/components/slider-inputs.tsx +150 -0
- package/src/lib/components/range-slider/components/tick.tsx +51 -0
- package/src/lib/components/range-slider/components/track.tsx +67 -0
- package/src/lib/components/range-slider/index.tsx +2 -0
- package/src/lib/components/range-slider/range-slider.test.tsx +185 -0
- package/src/lib/components/range-slider/range-slider.tsx +132 -0
- package/src/lib/components/range-slider/slider.test.tsx +89 -0
- package/src/lib/components/range-slider/slider.tsx +80 -0
- package/src/lib/components/range-slider/stories/components.tsx +179 -0
- package/src/lib/components/range-slider/stories/range-slider.stories.mdx +84 -0
- package/src/lib/components/range-slider/types.ts +18 -0
- package/src/lib/components/select/components/menu-container.tsx +69 -0
- package/src/lib/components/select/components/menu-list.tsx +195 -0
- package/src/lib/components/select/components/menu-row.tsx +43 -0
- package/src/lib/components/select/components/menu.tsx +151 -0
- package/src/lib/components/select/components/option.tsx +91 -0
- package/src/lib/components/select/components/select-label.tsx +10 -0
- package/src/lib/components/select/components/value-component-multi.tsx +40 -0
- package/src/lib/components/select/components/value-component-single.tsx +27 -0
- package/src/lib/components/select/components/value.tsx +370 -0
- package/src/lib/components/select/index.tsx +3 -0
- package/src/lib/components/select/select.test.tsx +148 -0
- package/src/lib/components/select/select.tsx +337 -0
- package/src/lib/components/select/storybook/components.tsx +999 -0
- package/src/lib/components/select/storybook/radio-group.tsx +157 -0
- package/src/lib/components/select/storybook/select.stories.mdx +172 -0
- package/src/lib/components/select/types.ts +149 -0
- package/src/lib/components/select/utils.ts +101 -0
- package/src/lib/components/spinner/index.tsx +1 -0
- package/src/lib/components/spinner/spinner-size-flags.tsx +39 -0
- package/src/lib/components/spinner/spinner.test.tsx +31 -0
- package/src/lib/components/spinner/spinner.tsx +54 -0
- package/src/lib/components/spinner/stories/components.tsx +39 -0
- package/src/lib/components/spinner/stories/spinner.stories.mdx +35 -0
- package/src/lib/components/tabs/components/index.ts +1 -0
- package/src/lib/components/tabs/components/tab.tsx +85 -0
- package/src/lib/components/tabs/index.tsx +1 -0
- package/src/lib/components/tabs/storybook/components.tsx +317 -0
- package/src/lib/components/tabs/storybook/tabs.stories.mdx +105 -0
- package/src/lib/components/tabs/tabs.test.tsx +86 -0
- package/src/lib/components/tabs/tabs.tsx +115 -0
- package/src/lib/components/tag/components/close-button.tsx +85 -0
- package/src/lib/components/tag/components/index.ts +2 -0
- package/src/lib/components/tag/components/tag-label.tsx +45 -0
- package/src/lib/components/tag/index.tsx +1 -0
- package/src/lib/components/tag/stories/components.tsx +86 -0
- package/src/lib/components/tag/stories/tag.stories.mdx +42 -0
- package/src/lib/components/tag/tag.test.tsx +36 -0
- package/src/lib/components/tag/tag.tsx +33 -0
- package/src/lib/components/thumbnail/index.tsx +1 -0
- package/src/lib/components/thumbnail/stories/thumbnail.stories.mdx +44 -0
- package/src/lib/components/thumbnail/thumbnail-size-flags.tsx +41 -0
- package/src/lib/components/thumbnail/thumbnail.test.tsx +51 -0
- package/src/lib/components/thumbnail/thumbnail.tsx +44 -0
- package/src/lib/components/tooltip/index.tsx +1 -0
- package/src/lib/components/tooltip/stories/components.tsx +224 -0
- package/src/lib/components/tooltip/stories/tooltip.stories.mdx +63 -0
- package/src/lib/components/tooltip/tooltip.test.tsx +22 -0
- package/src/lib/components/tooltip/tooltip.tsx +179 -0
- package/src/lib/components/tree-view/components/tree-node.tsx +203 -0
- package/src/lib/components/tree-view/helper.tsx +171 -0
- package/src/lib/components/tree-view/index.ts +2 -0
- package/src/lib/components/tree-view/stories/components.tsx +640 -0
- package/src/lib/components/tree-view/stories/tree-view.stories.mdx +127 -0
- package/src/lib/components/tree-view/tree-view.test.tsx +146 -0
- package/src/lib/components/tree-view/tree-view.tsx +168 -0
- package/src/lib/components/tree-view/types.tsx +70 -0
- package/src/lib/components/typography/index.ts +1 -0
- package/src/lib/components/typography/storybook/components.tsx +288 -0
- package/src/lib/components/typography/storybook/typography.stories.mdx +90 -0
- package/src/lib/components/typography/typography.test.tsx +97 -0
- package/src/lib/components/typography/typography.tsx +99 -0
- package/src/lib/foundations/color-system/base-palette/base-palette.stories.tsx +123 -0
- package/src/lib/foundations/color-system/base-palette/base-palette.ts +93 -0
- package/src/lib/foundations/color-system/base-palette/index.ts +1 -0
- package/src/lib/foundations/color-system/color-guidelines/color-guidelines.stories.mdx +85 -0
- package/src/lib/foundations/color-system/color-guidelines/color-guidelines.stories.tsx +231 -0
- package/src/lib/foundations/color-system/color-guidelines/color-guidelines.ts +160 -0
- package/src/lib/foundations/color-system/color-guidelines/index.ts +1 -0
- package/src/lib/foundations/color-system/components/color-sample.tsx +99 -0
- package/src/lib/foundations/color-system/components/index.ts +1 -0
- package/src/lib/foundations/color-system/index.ts +1 -0
- package/src/lib/foundations/index.ts +4 -0
- package/src/lib/foundations/shadows/components.tsx +59 -0
- package/src/lib/foundations/shadows/index.ts +1 -0
- package/src/lib/foundations/shadows/shadows.stories.mdx +71 -0
- package/src/lib/foundations/shadows/shadows.tsx +47 -0
- package/src/lib/foundations/spacing/index.ts +1 -0
- package/src/lib/foundations/spacing/spacing-guidelines.ts +37 -0
- package/src/lib/foundations/spacing/spacing.stories.mdx +51 -0
- package/src/lib/foundations/spacing/spacing.ts +18 -0
- package/src/lib/foundations/typography/constants.ts +25 -0
- package/src/lib/foundations/typography/fonts.ts +205 -0
- package/src/lib/foundations/typography/index.tsx +1 -0
- package/src/lib/foundations/typography/text-aspect-flags.ts +61 -0
- package/src/lib/foundations/typography/typography.tsx +102 -0
- package/src/lib/helpers/generic-types.ts +44 -0
- package/src/lib/helpers/index.ts +8 -0
- package/src/lib/helpers/isReactElementOfType.test.tsx +108 -0
- package/src/lib/helpers/isReactElementOfType.ts +42 -0
- package/src/lib/helpers/nothing.tsx +22 -0
- package/{lib/helpers/numbers.d.ts → src/lib/helpers/numbers.ts} +67 -50
- package/src/lib/helpers/safe-navigation.ts +57 -0
- package/src/lib/helpers/slots.tsx +126 -0
- package/src/lib/helpers/strings.test.ts +47 -0
- package/src/lib/helpers/strings.ts +16 -0
- package/src/lib/helpers/useInputElementState.ts +56 -0
- package/src/lib/helpers/useKeyDown.ts +17 -0
- package/tsconfig.json +35 -0
- package/tsconfig.lib.json +28 -0
- package/tsconfig.spec.json +21 -0
- package/index.d.ts +0 -2
- package/index.js +0 -11246
- package/lib/components/alert-banner/alert-banner.d.ts +0 -15
- package/lib/components/alert-banner/alert-level-flags.d.ts +0 -18
- package/lib/components/alert-banner/index.d.ts +0 -1
- package/lib/components/badge/badge-type-flags.d.ts +0 -18
- package/lib/components/badge/badge.d.ts +0 -5
- package/lib/components/badge/index.d.ts +0 -1
- package/lib/components/card/atoms/index.d.ts +0 -1
- package/lib/components/card/card.d.ts +0 -14
- package/lib/components/card/components/card-alert-banner-slot.d.ts +0 -6
- package/lib/components/card/components/card-controls-slot.d.ts +0 -5
- package/lib/components/card/components/card-section-slot.d.ts +0 -11
- package/lib/components/card/components/index.d.ts +0 -3
- package/lib/components/card/index.d.ts +0 -3
- package/lib/components/card/molecules/index.d.ts +0 -1
- package/lib/components/card/molecules/left-right-card.d.ts +0 -16
- package/lib/components/checkbox/checkbox.d.ts +0 -11
- package/lib/components/checkbox/helpers.d.ts +0 -12
- package/lib/components/checkbox/index.d.ts +0 -1
- package/lib/components/date-picker/components/custom-calendar.d.ts +0 -6
- package/lib/components/date-picker/components/index.d.ts +0 -1
- package/lib/components/date-picker/date-picker.d.ts +0 -4
- package/lib/components/date-picker/helpers/date-picker-factory.d.ts +0 -34
- package/lib/components/date-picker/index.d.ts +0 -1
- package/lib/components/divider/divider-type-flags.d.ts +0 -9
- package/lib/components/divider/divider.d.ts +0 -7
- package/lib/components/divider/index.d.ts +0 -1
- package/lib/components/flag/flag-size-flags.d.ts +0 -12
- package/lib/components/flag/flag.d.ts +0 -9
- package/lib/components/flag/flag.list.d.ts +0 -782
- package/lib/components/flag/index.d.ts +0 -1
- package/lib/components/icon/icon-list.d.ts +0 -132
- package/lib/components/icon/icon.d.ts +0 -131
- package/lib/components/icon/index.d.ts +0 -1
- package/lib/components/index.d.ts +0 -24
- package/lib/components/input-field/components/index.d.ts +0 -2
- package/lib/components/input-field/components/labeled-input.d.ts +0 -10
- package/lib/components/input-field/components/stepper.d.ts +0 -7
- package/lib/components/input-field/index.d.ts +0 -3
- package/lib/components/input-field/input-field.d.ts +0 -26
- package/lib/components/input-field/input-number.d.ts +0 -18
- package/lib/components/input-field/input-text.d.ts +0 -14
- package/lib/components/layout/flex.d.ts +0 -16
- package/lib/components/layout/grid-layout.d.ts +0 -11
- package/lib/components/layout/index.d.ts +0 -3
- package/lib/components/layout/left-right-layout.d.ts +0 -34
- package/lib/components/link/index.d.ts +0 -1
- package/lib/components/link/link.d.ts +0 -14
- package/lib/components/modal/index.d.ts +0 -3
- package/lib/components/modal/modal-base.d.ts +0 -28
- package/lib/components/modal/modal-destructive.d.ts +0 -11
- package/lib/components/modal/modal.d.ts +0 -13
- package/lib/components/molecules/avatar/avatar-size-flags.d.ts +0 -12
- package/lib/components/molecules/avatar/avatar.d.ts +0 -12
- package/lib/components/molecules/avatar/index.d.ts +0 -1
- package/lib/components/molecules/button/button-flags.d.ts +0 -44
- package/lib/components/molecules/button/button.d.ts +0 -12
- package/lib/components/molecules/button/index.d.ts +0 -1
- package/lib/components/molecules/index.d.ts +0 -3
- package/lib/components/molecules/input-checkbox/index.d.ts +0 -1
- package/lib/components/molecules/input-checkbox/input-checkbox.d.ts +0 -8
- package/lib/components/organisms/choice-list/choice-list.d.ts +0 -9
- package/lib/components/organisms/choice-list/index.d.ts +0 -1
- package/lib/components/organisms/index.d.ts +0 -2
- package/lib/components/organisms/multi-choice-list/index.d.ts +0 -1
- package/lib/components/organisms/multi-choice-list/multi-choice-list.d.ts +0 -11
- package/lib/components/radio-button/index.d.ts +0 -1
- package/lib/components/radio-button/radio-button.d.ts +0 -10
- package/lib/components/range-slider/components/bar-chart.d.ts +0 -8
- package/lib/components/range-slider/components/handle.d.ts +0 -12
- package/lib/components/range-slider/components/rail.d.ts +0 -9
- package/lib/components/range-slider/components/slider-component.d.ts +0 -12
- package/lib/components/range-slider/components/slider-inputs.d.ts +0 -14
- package/lib/components/range-slider/components/tick.d.ts +0 -10
- package/lib/components/range-slider/components/track.d.ts +0 -11
- package/lib/components/range-slider/index.d.ts +0 -2
- package/lib/components/range-slider/range-slider.d.ts +0 -15
- package/lib/components/range-slider/slider.d.ts +0 -11
- package/lib/components/range-slider/types.d.ts +0 -11
- package/lib/components/select/components/menu-container.d.ts +0 -3
- package/lib/components/select/components/menu-list.d.ts +0 -3
- package/lib/components/select/components/menu-row.d.ts +0 -9
- package/lib/components/select/components/menu.d.ts +0 -3
- package/lib/components/select/components/option.d.ts +0 -13
- package/lib/components/select/components/select-label.d.ts +0 -1
- package/lib/components/select/components/value-component-multi.d.ts +0 -4
- package/lib/components/select/components/value-component-single.d.ts +0 -4
- package/lib/components/select/components/value.d.ts +0 -4
- package/lib/components/select/index.d.ts +0 -3
- package/lib/components/select/select.d.ts +0 -10
- package/lib/components/select/types.d.ts +0 -133
- package/lib/components/select/utils.d.ts +0 -15
- package/lib/components/spinner/spinner-size-flags.d.ts +0 -10
- package/lib/components/spinner/spinner.d.ts +0 -9
- package/lib/components/tabs/components/index.d.ts +0 -1
- package/lib/components/tabs/components/tab.d.ts +0 -8
- package/lib/components/tabs/index.d.ts +0 -1
- package/lib/components/tabs/tabs.d.ts +0 -16
- package/lib/components/tag/components/close-button.d.ts +0 -8
- package/lib/components/tag/components/index.d.ts +0 -2
- package/lib/components/tag/components/tag-label.d.ts +0 -8
- package/lib/components/tag/index.d.ts +0 -1
- package/lib/components/tag/tag.d.ts +0 -10
- package/lib/components/thumbnail/index.d.ts +0 -1
- package/lib/components/thumbnail/thumbnail-size-flags.d.ts +0 -10
- package/lib/components/thumbnail/thumbnail.d.ts +0 -10
- package/lib/components/tooltip/index.d.ts +0 -1
- package/lib/components/tooltip/tooltip.d.ts +0 -26
- package/lib/components/tree-view/components/tree-node.d.ts +0 -3
- package/lib/components/tree-view/helper.d.ts +0 -12
- package/lib/components/tree-view/index.d.ts +0 -2
- package/lib/components/tree-view/tree-view.d.ts +0 -3
- package/lib/components/tree-view/types.d.ts +0 -63
- package/lib/components/typography/index.d.ts +0 -1
- package/lib/components/typography/typography.d.ts +0 -24
- package/lib/foundations/color-system/base-palette/base-palette.d.ts +0 -76
- package/lib/foundations/color-system/base-palette/index.d.ts +0 -1
- package/lib/foundations/color-system/color-guidelines/color-guidelines.d.ts +0 -133
- package/lib/foundations/color-system/color-guidelines/index.d.ts +0 -1
- package/lib/foundations/color-system/components/color-sample.d.ts +0 -17
- package/lib/foundations/color-system/components/index.d.ts +0 -1
- package/lib/foundations/color-system/index.d.ts +0 -1
- package/lib/foundations/index.d.ts +0 -4
- package/lib/foundations/shadows/components.d.ts +0 -8
- package/lib/foundations/shadows/index.d.ts +0 -1
- package/lib/foundations/shadows/shadows.d.ts +0 -8
- package/lib/foundations/spacing/index.d.ts +0 -1
- package/lib/foundations/spacing/spacing-guidelines.d.ts +0 -33
- package/lib/foundations/spacing/spacing.d.ts +0 -18
- package/lib/foundations/typography/constants.d.ts +0 -22
- package/lib/foundations/typography/fonts.d.ts +0 -1
- package/lib/foundations/typography/index.d.ts +0 -1
- package/lib/foundations/typography/text-aspect-flags.d.ts +0 -19
- package/lib/foundations/typography/typography.d.ts +0 -24
- package/lib/helpers/generic-types.d.ts +0 -21
- package/lib/helpers/index.d.ts +0 -8
- package/lib/helpers/isReactElementOfType.d.ts +0 -8
- package/lib/helpers/nothing.d.ts +0 -10
- package/lib/helpers/safe-navigation.d.ts +0 -17
- package/lib/helpers/slots.d.ts +0 -17
- package/lib/helpers/strings.d.ts +0 -1
- package/lib/helpers/useInputElementState.d.ts +0 -30
- package/lib/helpers/useKeyDown.d.ts +0 -1
|
@@ -0,0 +1,999 @@
|
|
|
1
|
+
/* eslint-disable no-restricted-syntax */
|
|
2
|
+
import { Borders, Icons, Padding, shadowMd, Surface } from '@foundations'
|
|
3
|
+
import { Flag } from 'components/flag'
|
|
4
|
+
import { CountryCodes } from 'components/flag/flag.list'
|
|
5
|
+
import { Body, Label } from 'components/typography'
|
|
6
|
+
import { useState } from 'react'
|
|
7
|
+
import { Playground } from 'storybook-addon-jarle-monaco'
|
|
8
|
+
import styled from 'styled-components'
|
|
9
|
+
import { Margin } from '@foundations'
|
|
10
|
+
import { Select } from '../select'
|
|
11
|
+
import { IOption } from '../types'
|
|
12
|
+
import { isNil, safeArray, maybeRender, isDefined, is } from '@helpers'
|
|
13
|
+
import { IconMinor } from 'components/icon'
|
|
14
|
+
import { RadioButtonGroup } from './radio-group'
|
|
15
|
+
import { Checkbox } from 'components/checkbox'
|
|
16
|
+
import { InputText } from 'components/input-field'
|
|
17
|
+
import { MenuList } from '../components/menu-list'
|
|
18
|
+
|
|
19
|
+
interface IValue {
|
|
20
|
+
id: string
|
|
21
|
+
value: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type ICountryList = {
|
|
25
|
+
[key in CountryCodes]: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const FlexWrapper = styled.div`
|
|
29
|
+
height: 250px;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: revert;
|
|
32
|
+
align-items: flex-start;
|
|
33
|
+
margin: 12px;
|
|
34
|
+
gap: 12px;
|
|
35
|
+
& > div {
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
`
|
|
39
|
+
|
|
40
|
+
const CustomListFrame = styled.div`
|
|
41
|
+
border: 1px solid ${Borders.Default.Subdued};
|
|
42
|
+
background-color: ${Surface.Default.Default};
|
|
43
|
+
position: absolute;
|
|
44
|
+
width: 100%;
|
|
45
|
+
max-height: 180px;
|
|
46
|
+
overflow-y: auto;
|
|
47
|
+
overflow-x: hidden;
|
|
48
|
+
::-webkit-scrollbar {
|
|
49
|
+
width: 6px;
|
|
50
|
+
height: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
::-webkit-scrollbar-thumb {
|
|
54
|
+
border-radius: 4px;
|
|
55
|
+
background: ${Surface.Neutral.Default};
|
|
56
|
+
min-height: 50px;
|
|
57
|
+
}
|
|
58
|
+
${shadowMd};
|
|
59
|
+
`
|
|
60
|
+
|
|
61
|
+
const CustomRow = styled.div<{active?: boolean}>`
|
|
62
|
+
border: none;
|
|
63
|
+
text-align: left;
|
|
64
|
+
border: 1px solid ${Borders.Default.Subdued};
|
|
65
|
+
margin: ${Margin.xxxs};
|
|
66
|
+
border-radius: 6px;
|
|
67
|
+
background-color: ${(props) =>
|
|
68
|
+
(is(props.active)
|
|
69
|
+
? Surface.Selected.Default
|
|
70
|
+
: Surface.Default.Default)};
|
|
71
|
+
|
|
72
|
+
&:hover {
|
|
73
|
+
background-color: ${Surface.Default.Hover};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
background-color: ${(props) => (is(props.active) ?Surface.Selected.Hover : Surface.Default.Hover)}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&:active {
|
|
81
|
+
background-color: ${(props) => (is(props.active) ? Surface.Selected.Pressed : Surface.Default.Pressed)};
|
|
82
|
+
}
|
|
83
|
+
`
|
|
84
|
+
|
|
85
|
+
const CustomLabel = styled(Label)`
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
padding: ${Padding.xxs} ${Padding.xs};
|
|
88
|
+
margin-left: ${Margin.l};
|
|
89
|
+
`
|
|
90
|
+
|
|
91
|
+
const SupportText = styled(CustomLabel)`
|
|
92
|
+
padding-top: ${Padding.none};
|
|
93
|
+
`
|
|
94
|
+
|
|
95
|
+
const IconWraper = styled.div`
|
|
96
|
+
position: relative;
|
|
97
|
+
top: 4px;
|
|
98
|
+
left: 6px;
|
|
99
|
+
& i {
|
|
100
|
+
position: absolute;
|
|
101
|
+
}
|
|
102
|
+
`
|
|
103
|
+
|
|
104
|
+
const StarSolid = styled(IconMinor.StarSolid)`
|
|
105
|
+
svg {
|
|
106
|
+
path {
|
|
107
|
+
fill: ${Icons.Critical};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
`
|
|
111
|
+
const MugTea = styled(IconMinor.MugTea)`
|
|
112
|
+
svg {
|
|
113
|
+
path {
|
|
114
|
+
fill: ${Icons.Success};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`
|
|
118
|
+
|
|
119
|
+
const CheckBoxWraper = styled.div`
|
|
120
|
+
display: flex;
|
|
121
|
+
gap: 6px;
|
|
122
|
+
padding: ${Padding.xs};
|
|
123
|
+
align-self: flex-start;
|
|
124
|
+
flex-direction: row-reverse;
|
|
125
|
+
float: left;
|
|
126
|
+
div:last-of-type {
|
|
127
|
+
min-width: 110px;
|
|
128
|
+
}
|
|
129
|
+
`
|
|
130
|
+
|
|
131
|
+
const PersonPraying = styled(IconMinor.PersonPraying)`
|
|
132
|
+
svg {
|
|
133
|
+
path {
|
|
134
|
+
fill: ${Icons.Warning};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
`
|
|
138
|
+
|
|
139
|
+
const FireBurner = styled(IconMinor.FireBurner)`
|
|
140
|
+
svg {
|
|
141
|
+
path {
|
|
142
|
+
fill: ${Icons.Highlight};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
`
|
|
146
|
+
|
|
147
|
+
export const SelectOptions = () => (
|
|
148
|
+
<Playground
|
|
149
|
+
code={`
|
|
150
|
+
/* Edit this code sample! */
|
|
151
|
+
type ISelectedValue = string | string[];
|
|
152
|
+
|
|
153
|
+
const [value, setValue] = useState<ISelectedValue>();
|
|
154
|
+
const [isMulti, setIsMulti] = useState<boolean>(false);
|
|
155
|
+
const [labelPosition, setLabelPosition] = useState<string>('top');
|
|
156
|
+
const [label, setLabel] = useState<string>('My Label');
|
|
157
|
+
const [clearable, setClearable] = useState<boolean>(false);
|
|
158
|
+
const [searchable, setSearchable] = useState<boolean>(false);
|
|
159
|
+
const [disabled, setDisabled] = useState<boolean>(false);
|
|
160
|
+
const [invalid, setInvalid] = useState<boolean>(false);
|
|
161
|
+
const [placeholder, setPlaceholder] = useState<string>('');
|
|
162
|
+
const [menuPosition, setMenuPosition] = useState<string>('bottom');
|
|
163
|
+
const [alignSelf, setAlignSelf] = useState<string>('start');
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
const labelPositionValues = [
|
|
167
|
+
{
|
|
168
|
+
label: 'Top',
|
|
169
|
+
value: 'top',
|
|
170
|
+
name: 'labelTypes'
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
label: 'Side',
|
|
174
|
+
value: 'side',
|
|
175
|
+
name: 'labelTypes'
|
|
176
|
+
}
|
|
177
|
+
];
|
|
178
|
+
|
|
179
|
+
const multiValues = [
|
|
180
|
+
{
|
|
181
|
+
label: 'Single',
|
|
182
|
+
value: 'single',
|
|
183
|
+
name: 'multi'
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
label: 'Multi',
|
|
187
|
+
value: 'multi',
|
|
188
|
+
name: 'multi'
|
|
189
|
+
},
|
|
190
|
+
];
|
|
191
|
+
|
|
192
|
+
const menuPositionValues = [
|
|
193
|
+
{
|
|
194
|
+
label: 'Bottom',
|
|
195
|
+
value: 'bottom',
|
|
196
|
+
name: 'menuPositionTypes'
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
label: 'Top',
|
|
200
|
+
value: 'top',
|
|
201
|
+
name: 'menuPositionTypes'
|
|
202
|
+
}
|
|
203
|
+
];
|
|
204
|
+
|
|
205
|
+
const handleValueChange = (selectedValue: ISelectedValue) => {
|
|
206
|
+
setValue(selectedValue)
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const handleTypeChange = (selectedValue: string) => {
|
|
210
|
+
const isMultiSelect = (selectedValue === 'multi')
|
|
211
|
+
setValue(isMultiSelect ? [] : undefined)
|
|
212
|
+
setIsMulti(isMultiSelect)
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const handleLabelChange = (selectedValue: string) => {
|
|
216
|
+
setLabelPosition(selectedValue)
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const handlemenuPositionChange = (selectedValue: string) => {
|
|
220
|
+
setMenuPosition(selectedValue)
|
|
221
|
+
const newAlign = (alignSelf === 'start' ? 'end' : 'start' )
|
|
222
|
+
setAlignSelf(newAlign)
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
<FlexWrapper style={{height: 'unset'}}>
|
|
226
|
+
<div style={{display: 'flex', flexDirection: 'column'}}>
|
|
227
|
+
<div style={{width: '260px'}}>
|
|
228
|
+
<InputText label='Change the Select Label' value={label} onChange={setLabel}/>
|
|
229
|
+
</div>
|
|
230
|
+
<div style={{width: '260px'}}>
|
|
231
|
+
<InputText label='Select Placeholder' value={placeholder} onChange={setPlaceholder}/>
|
|
232
|
+
</div>
|
|
233
|
+
<RadioButtonGroup
|
|
234
|
+
label="Select Type:"
|
|
235
|
+
options={multiValues}
|
|
236
|
+
onChange={handleTypeChange}
|
|
237
|
+
/>
|
|
238
|
+
<RadioButtonGroup
|
|
239
|
+
label="Label Position:"
|
|
240
|
+
options={labelPositionValues}
|
|
241
|
+
onChange={handleLabelChange}
|
|
242
|
+
/>
|
|
243
|
+
<RadioButtonGroup
|
|
244
|
+
label="Menu Position:"
|
|
245
|
+
options={menuPositionValues}
|
|
246
|
+
onChange={handlemenuPositionChange}
|
|
247
|
+
/>
|
|
248
|
+
<CheckBoxWraper>
|
|
249
|
+
<Checkbox checked={clearable} onChange={() => setClearable(!clearable)}/>
|
|
250
|
+
<Label>Clearable : </Label>
|
|
251
|
+
</CheckBoxWraper>
|
|
252
|
+
<CheckBoxWraper>
|
|
253
|
+
<Checkbox checked={searchable} onChange={() => setSearchable(!searchable)}/>
|
|
254
|
+
<Label>Searchable :</Label>
|
|
255
|
+
</CheckBoxWraper>
|
|
256
|
+
<CheckBoxWraper>
|
|
257
|
+
<Checkbox checked={disabled} onChange={() => setDisabled(!disabled)}/>
|
|
258
|
+
<Label>Disabled :</Label>
|
|
259
|
+
</CheckBoxWraper>
|
|
260
|
+
<CheckBoxWraper>
|
|
261
|
+
<Checkbox checked={invalid} onChange={() => setInvalid(!invalid)}/>
|
|
262
|
+
<Label>Invalid :</Label>
|
|
263
|
+
</CheckBoxWraper>
|
|
264
|
+
</div>
|
|
265
|
+
<div style={{alignSelf: alignSelf, margin: '100px 0px'}}>
|
|
266
|
+
<Select
|
|
267
|
+
menuPosition={menuPosition}
|
|
268
|
+
multi={isMulti}
|
|
269
|
+
value={value}
|
|
270
|
+
clearable={clearable}
|
|
271
|
+
searchable={searchable}
|
|
272
|
+
onChange={handleValueChange}
|
|
273
|
+
options={options1}
|
|
274
|
+
placeholder={placeholder}
|
|
275
|
+
labelPosition={labelPosition}
|
|
276
|
+
label={label}
|
|
277
|
+
invalid={invalid}
|
|
278
|
+
disabled={disabled}
|
|
279
|
+
/>
|
|
280
|
+
</div>
|
|
281
|
+
</FlexWrapper>
|
|
282
|
+
`}
|
|
283
|
+
providerProps={{
|
|
284
|
+
renderAsComponent: true,
|
|
285
|
+
scope: {
|
|
286
|
+
Select,
|
|
287
|
+
useState,
|
|
288
|
+
options1,
|
|
289
|
+
Label,
|
|
290
|
+
RadioButtonGroup,
|
|
291
|
+
Checkbox,
|
|
292
|
+
InputText,
|
|
293
|
+
CheckBoxWraper,
|
|
294
|
+
FlexWrapper,
|
|
295
|
+
},
|
|
296
|
+
}}
|
|
297
|
+
/>
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
export const CustomLabelComponent = () => (
|
|
301
|
+
<Playground
|
|
302
|
+
code={`
|
|
303
|
+
/* Edit this code sample! */
|
|
304
|
+
/*
|
|
305
|
+
IValue is the type you pass to the IOption interface
|
|
306
|
+
|
|
307
|
+
interface IValue {
|
|
308
|
+
id: string
|
|
309
|
+
value: string
|
|
310
|
+
}
|
|
311
|
+
*/
|
|
312
|
+
const [value, setValue] = useState<IValue>();
|
|
313
|
+
|
|
314
|
+
const onChange = (selectedValue: IValue) => {
|
|
315
|
+
setValue(selectedValue)
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
const labelComponent = (props: IOption<IValue>) => (
|
|
319
|
+
<div style={{display: 'flex', gap: '6px'}}>
|
|
320
|
+
<Flag medium code={props['code']} style={{right: '0'}}/>
|
|
321
|
+
<Body default style={{padding: '0'}}>{props['children']}</Body>
|
|
322
|
+
</div>
|
|
323
|
+
);
|
|
324
|
+
|
|
325
|
+
<FlexWrapper>
|
|
326
|
+
<div>
|
|
327
|
+
<Select
|
|
328
|
+
placeholder="Please select..."
|
|
329
|
+
options={options2}
|
|
330
|
+
onChange={onChange}
|
|
331
|
+
labelComponent={labelComponent}
|
|
332
|
+
value={value}
|
|
333
|
+
labelPosition='top'
|
|
334
|
+
searchable
|
|
335
|
+
label='Select a Country'
|
|
336
|
+
/>
|
|
337
|
+
</div>
|
|
338
|
+
<span>{
|
|
339
|
+
isDefined(value)
|
|
340
|
+
? <Label>You Selected: {JSON.stringify(value)}</Label>
|
|
341
|
+
: <Label>Select Something...</Label>
|
|
342
|
+
}</span>
|
|
343
|
+
<div>
|
|
344
|
+
</div>
|
|
345
|
+
</FlexWrapper>
|
|
346
|
+
`}
|
|
347
|
+
providerProps={{
|
|
348
|
+
renderAsComponent: true,
|
|
349
|
+
scope: {
|
|
350
|
+
Select,
|
|
351
|
+
isDefined,
|
|
352
|
+
useState,
|
|
353
|
+
options2,
|
|
354
|
+
Label,
|
|
355
|
+
Flag,
|
|
356
|
+
Body,
|
|
357
|
+
FlexWrapper,
|
|
358
|
+
},
|
|
359
|
+
}}
|
|
360
|
+
/>
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
export const HugeListWithCustomLabelComponent = () => (
|
|
364
|
+
<Playground
|
|
365
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
366
|
+
code={`
|
|
367
|
+
/* Edit this code sample! */
|
|
368
|
+
/*
|
|
369
|
+
IValue is the type you pass to the IOption interface
|
|
370
|
+
|
|
371
|
+
interface IValue {
|
|
372
|
+
id: string
|
|
373
|
+
value: string
|
|
374
|
+
}
|
|
375
|
+
*/
|
|
376
|
+
const [value, setValue] = useState<ICountryValue[]>([]);
|
|
377
|
+
|
|
378
|
+
const countryList: IOption<ICountryValue>[] = (Object.keys(CountryList) as (CountryCodes)[])
|
|
379
|
+
.map(code => ({
|
|
380
|
+
label: CountryList[code],
|
|
381
|
+
value: {
|
|
382
|
+
code: code,
|
|
383
|
+
value: CountryList[code]
|
|
384
|
+
}
|
|
385
|
+
}));
|
|
386
|
+
|
|
387
|
+
const onChange = (selectedValue: ICountryValue[]) => {
|
|
388
|
+
setValue(selectedValue)
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
const labelComponent = (props: IOption<ICountryValue>) => (
|
|
392
|
+
<div style={{display: 'flex', gap: '6px', pointerEvents: 'none'}}>
|
|
393
|
+
<Flag medium code={props['value']['code']}/>
|
|
394
|
+
<Body default>{props['children']}</Body>
|
|
395
|
+
</div>
|
|
396
|
+
);
|
|
397
|
+
|
|
398
|
+
<FlexWrapper>
|
|
399
|
+
<div>
|
|
400
|
+
<Select
|
|
401
|
+
placeholder="Please select..."
|
|
402
|
+
options={countryList}
|
|
403
|
+
onChange={onChange}
|
|
404
|
+
labelComponent={labelComponent}
|
|
405
|
+
value={value}
|
|
406
|
+
labelPosition='top'
|
|
407
|
+
searchable
|
|
408
|
+
clearable
|
|
409
|
+
label='Select a Country'
|
|
410
|
+
/>
|
|
411
|
+
</div>
|
|
412
|
+
<div>
|
|
413
|
+
<div>{isNil(value?.code) ? <Label>Select Something...</Label> : <Label>You Selected: {JSON.stringify(value)}</Label> }</div>
|
|
414
|
+
{
|
|
415
|
+
maybeRender(value?.code, <div style={{margin: '${Margin.l} ${Margin.none}', textAlign: 'center', display: 'flex'}}>
|
|
416
|
+
<Label style={{margin: '${Margin.xxs}'}}>Flag: </Label><IconWraper><Flag large code={value?.code}/></IconWraper>
|
|
417
|
+
</div>)
|
|
418
|
+
}
|
|
419
|
+
</div>
|
|
420
|
+
</FlexWrapper>
|
|
421
|
+
`}
|
|
422
|
+
providerProps={{
|
|
423
|
+
renderAsComponent: true,
|
|
424
|
+
scope: {
|
|
425
|
+
Select,
|
|
426
|
+
useState,
|
|
427
|
+
options2,
|
|
428
|
+
Label,
|
|
429
|
+
Flag,
|
|
430
|
+
Body,
|
|
431
|
+
Margin,
|
|
432
|
+
isNil,
|
|
433
|
+
maybeRender,
|
|
434
|
+
IconWraper,
|
|
435
|
+
CountryList,
|
|
436
|
+
FlexWrapper,
|
|
437
|
+
},
|
|
438
|
+
}}
|
|
439
|
+
/>
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
export const CustomValidation = () => (
|
|
443
|
+
<Playground
|
|
444
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
445
|
+
code={`
|
|
446
|
+
/* Edit this code sample! */
|
|
447
|
+
const [value, setValue] = useState<string>()
|
|
448
|
+
const [errorsList, setErrorsList] = useState<{message: string}[]>([])
|
|
449
|
+
const isMounted = useRef(false);
|
|
450
|
+
|
|
451
|
+
useEffect(() => {
|
|
452
|
+
if (!isMounted.current) {
|
|
453
|
+
isMounted.current = true
|
|
454
|
+
return
|
|
455
|
+
}
|
|
456
|
+
checkForErros()
|
|
457
|
+
}, [value]);
|
|
458
|
+
|
|
459
|
+
/*
|
|
460
|
+
Use onChange and onClose
|
|
461
|
+
*/
|
|
462
|
+
const onChange = (selectedValue: string) => {
|
|
463
|
+
setValue(selectedValue)
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
const onClose = () => {
|
|
467
|
+
checkForErros()
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
const checkForErros = () => {
|
|
471
|
+
const errors = []
|
|
472
|
+
if (isNil(value)) {
|
|
473
|
+
errors.push({ message: 'This field is required' })
|
|
474
|
+
}
|
|
475
|
+
setErrorsList(errors)
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
<FlexWrapper>
|
|
479
|
+
<div>
|
|
480
|
+
<Select
|
|
481
|
+
value={value}
|
|
482
|
+
onChange={onChange}
|
|
483
|
+
onClose={onClose}
|
|
484
|
+
options={options1}
|
|
485
|
+
clearable
|
|
486
|
+
invalid={errorsList.length > 0}
|
|
487
|
+
errors={errorsList}
|
|
488
|
+
/>
|
|
489
|
+
</div>
|
|
490
|
+
</FlexWrapper>
|
|
491
|
+
|
|
492
|
+
`}
|
|
493
|
+
providerProps={{
|
|
494
|
+
renderAsComponent: true,
|
|
495
|
+
scope: {
|
|
496
|
+
Select,
|
|
497
|
+
options1,
|
|
498
|
+
Margin,
|
|
499
|
+
isNil,
|
|
500
|
+
FlexWrapper,
|
|
501
|
+
},
|
|
502
|
+
}}
|
|
503
|
+
/>
|
|
504
|
+
)
|
|
505
|
+
|
|
506
|
+
export const CustomMenu = () => (
|
|
507
|
+
<Playground
|
|
508
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
509
|
+
code={`
|
|
510
|
+
/* Edit this code sample! */
|
|
511
|
+
const [value, setValue] = useState<string>();
|
|
512
|
+
const [errors, setErrors] = useState<{message: string}[]>([]);
|
|
513
|
+
|
|
514
|
+
const handleClick = (props: IMenuComponentProps, option: IOption) => {
|
|
515
|
+
alert(\`You choose \${option.label}\`)
|
|
516
|
+
props.onSelect(option.value)
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
const handleChange = (selected: string) => {
|
|
520
|
+
const newErros = []
|
|
521
|
+
setValue(selected)
|
|
522
|
+
if (selected !== 'Brasil') {
|
|
523
|
+
newErros.push({message:'Wrong one =('})
|
|
524
|
+
}
|
|
525
|
+
setErrors(newErros)
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
const menuComponent = (props: IMenuComponentProps) => (
|
|
529
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
530
|
+
<CustomListFrame>
|
|
531
|
+
{(safeArray(props.options)).map((option, i) => (
|
|
532
|
+
<CustomRow active={props.selectedIndex === i} key={i} onClick={() => handleClick(props, option)}>
|
|
533
|
+
<IconWraper>
|
|
534
|
+
{option['icon']}
|
|
535
|
+
</IconWraper>
|
|
536
|
+
<CustomLabel>
|
|
537
|
+
{option.label}
|
|
538
|
+
</CustomLabel>
|
|
539
|
+
<SupportText subdued>
|
|
540
|
+
{option['helperText']}
|
|
541
|
+
</SupportText>
|
|
542
|
+
</CustomRow>
|
|
543
|
+
))}
|
|
544
|
+
</CustomListFrame>
|
|
545
|
+
);
|
|
546
|
+
|
|
547
|
+
<FlexWrapper style={{marginTop: '25px', width: '300px'}}>
|
|
548
|
+
|
|
549
|
+
<div>
|
|
550
|
+
<Label>The Southernmost Country?</Label>
|
|
551
|
+
<Select
|
|
552
|
+
invalid={errors.length > 0}
|
|
553
|
+
errors={errors}
|
|
554
|
+
value={value}
|
|
555
|
+
onChange={handleChange}
|
|
556
|
+
options={options3}
|
|
557
|
+
menuComponent={menuComponent}
|
|
558
|
+
label='Curiosities'
|
|
559
|
+
labelPosition='top'
|
|
560
|
+
/>
|
|
561
|
+
</div>
|
|
562
|
+
</FlexWrapper>
|
|
563
|
+
|
|
564
|
+
`}
|
|
565
|
+
providerProps={{
|
|
566
|
+
renderAsComponent: true,
|
|
567
|
+
scope: {
|
|
568
|
+
Select,
|
|
569
|
+
safeArray,
|
|
570
|
+
useState,
|
|
571
|
+
options3,
|
|
572
|
+
Label,
|
|
573
|
+
FlexWrapper,
|
|
574
|
+
CustomListFrame,
|
|
575
|
+
CustomRow,
|
|
576
|
+
CustomLabel,
|
|
577
|
+
SupportText,
|
|
578
|
+
IconWraper,
|
|
579
|
+
},
|
|
580
|
+
}}
|
|
581
|
+
/>
|
|
582
|
+
)
|
|
583
|
+
|
|
584
|
+
export const FancyMenu = () => (
|
|
585
|
+
<Playground
|
|
586
|
+
code={`
|
|
587
|
+
/* Edit this code sample! */
|
|
588
|
+
|
|
589
|
+
const [value, setValue] = useState<string>(undefined);
|
|
590
|
+
|
|
591
|
+
const [withIcon, setWithIcon] = useState<boolean>(true);
|
|
592
|
+
const [withSupport, setWithSupport] = useState<boolean>(true);
|
|
593
|
+
const [withMenuTitle, setWithMenuTitle] = useState<boolean>(true);
|
|
594
|
+
const [selectOptions, setSelectOptions] = useState([]);
|
|
595
|
+
const [menuTitle, setMenuTitle] = useState(undefined);
|
|
596
|
+
|
|
597
|
+
useEffect(() => {
|
|
598
|
+
setMenuTitle(withMenuTitle ? 'Menu Title' : undefined)
|
|
599
|
+
}, [withMenuTitle])
|
|
600
|
+
|
|
601
|
+
useEffect(() => {
|
|
602
|
+
setSelectOptions(options1.map((opt) => ({
|
|
603
|
+
...opt,
|
|
604
|
+
...(withIcon && {icon: <IconMinor.Clone />}),
|
|
605
|
+
...(withSupport && {helperText: 'Lorem ipsum dolor sit amet'})
|
|
606
|
+
})));
|
|
607
|
+
|
|
608
|
+
}, [withIcon, withSupport]);
|
|
609
|
+
|
|
610
|
+
<FlexWrapper style={{}}>
|
|
611
|
+
<div style={{display: 'flex', flexDirection: 'column'}}>
|
|
612
|
+
<CheckBoxWraper style={{width: '160px', justifyContent: 'space-between'}}>
|
|
613
|
+
<Checkbox checked={withIcon} onChange={() => setWithIcon(!withIcon)}/>
|
|
614
|
+
<Label>With Icon : </Label>
|
|
615
|
+
</CheckBoxWraper>
|
|
616
|
+
<CheckBoxWraper style={{width: '160px', justifyContent: 'space-between'}}>
|
|
617
|
+
<Checkbox checked={withSupport} onChange={() => setWithSupport(!withSupport)}/>
|
|
618
|
+
<Label>With Support Text :</Label>
|
|
619
|
+
</CheckBoxWraper>
|
|
620
|
+
<CheckBoxWraper style={{width: '160px', justifyContent: 'space-between'}}>
|
|
621
|
+
<Checkbox checked={withMenuTitle} onChange={() => setWithMenuTitle(!withMenuTitle)}/>
|
|
622
|
+
<Label>With Menu Title :</Label>
|
|
623
|
+
</CheckBoxWraper>
|
|
624
|
+
</div>
|
|
625
|
+
<div>
|
|
626
|
+
<Select
|
|
627
|
+
value={value}
|
|
628
|
+
onChange={setValue}
|
|
629
|
+
options={selectOptions}
|
|
630
|
+
labelPosition="top"
|
|
631
|
+
placeholder="Select Something"
|
|
632
|
+
menuComponent={MenuList}
|
|
633
|
+
label="Cool Label"
|
|
634
|
+
menuTitle={menuTitle}
|
|
635
|
+
/>
|
|
636
|
+
</div>
|
|
637
|
+
</FlexWrapper>
|
|
638
|
+
`}
|
|
639
|
+
providerProps={{
|
|
640
|
+
renderAsComponent: true,
|
|
641
|
+
scope: {
|
|
642
|
+
Select,
|
|
643
|
+
options1,
|
|
644
|
+
Label,
|
|
645
|
+
IconMinor,
|
|
646
|
+
Checkbox,
|
|
647
|
+
CheckBoxWraper,
|
|
648
|
+
FlexWrapper,
|
|
649
|
+
MenuList,
|
|
650
|
+
},
|
|
651
|
+
}}
|
|
652
|
+
/>
|
|
653
|
+
)
|
|
654
|
+
|
|
655
|
+
const options1: IOption[] = [
|
|
656
|
+
{
|
|
657
|
+
label: 'Yu Yu Hakusho',
|
|
658
|
+
value: '01' ,
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
label: 'Neon Genesis Evangelion',
|
|
662
|
+
value: '02',
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
label: 'Dragon Ball Z',
|
|
666
|
+
value: '03',
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
label: 'Legend of Heavenly Sphere Shurato',
|
|
670
|
+
value: '04',
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
label: 'Ronin Warriors',
|
|
674
|
+
value: '05',
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
label: 'Knights of the Zodiac',
|
|
678
|
+
value: '06',
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
label: 'Rurouni Kenshin',
|
|
682
|
+
value: '07',
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
label: 'Avatar the Last Airbender',
|
|
686
|
+
value: '08',
|
|
687
|
+
}
|
|
688
|
+
]
|
|
689
|
+
|
|
690
|
+
const options2: IOption<IValue>[] = [
|
|
691
|
+
{
|
|
692
|
+
value: {id: 'BR', value: 'Brasil'},
|
|
693
|
+
label: 'Brasil',
|
|
694
|
+
code: 'BR',
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
value: {id: 'CA', value: 'Canada'},
|
|
698
|
+
label: 'Canada',
|
|
699
|
+
code: 'CA',
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
value: {id: 'MX', value: 'Mexico'},
|
|
703
|
+
label: 'Mexico',
|
|
704
|
+
code: 'MX',
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
value: {id: 'US', value: 'United States'},
|
|
708
|
+
label: 'United States',
|
|
709
|
+
code: 'US',
|
|
710
|
+
}
|
|
711
|
+
]
|
|
712
|
+
|
|
713
|
+
const options3: IOption[] = [
|
|
714
|
+
{
|
|
715
|
+
value: 'Brasil',
|
|
716
|
+
label: 'Brasil',
|
|
717
|
+
icon: <MugTea/>,
|
|
718
|
+
helperText: 'Larges in the South America',
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
value: 'Canada',
|
|
722
|
+
label: 'Canada',
|
|
723
|
+
icon: <FireBurner />,
|
|
724
|
+
helperText: 'Very very cold',
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
value: 'Mexico',
|
|
728
|
+
label: 'Mexico',
|
|
729
|
+
icon: <PersonPraying />,
|
|
730
|
+
helperText: 'Really hot food!',
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
value: 'United States',
|
|
734
|
+
label: 'United States',
|
|
735
|
+
icon: <StarSolid/>,
|
|
736
|
+
helperText: 'Land of the Free',
|
|
737
|
+
}
|
|
738
|
+
]
|
|
739
|
+
|
|
740
|
+
const CountryList: ICountryList = {
|
|
741
|
+
'AD': 'Andorra',
|
|
742
|
+
'AE': 'United Arab Emirates',
|
|
743
|
+
'AF': 'Afghanistan',
|
|
744
|
+
'AG': 'Antigua and Barbuda',
|
|
745
|
+
'AI': 'Anguilla',
|
|
746
|
+
'AL': 'Albania',
|
|
747
|
+
'AM': 'Armenia',
|
|
748
|
+
'AO': 'Angola',
|
|
749
|
+
'AQ': 'Antarctica',
|
|
750
|
+
'AR': 'Argentina',
|
|
751
|
+
'AS': 'American Samoa',
|
|
752
|
+
'AT': 'Austria',
|
|
753
|
+
'AU': 'Australia',
|
|
754
|
+
'AW': 'Aruba',
|
|
755
|
+
'AX': 'Aland Islands',
|
|
756
|
+
'AZ': 'Azerbaijan',
|
|
757
|
+
'BA': 'Bosnia and Herzegovina',
|
|
758
|
+
'BB': 'Barbados',
|
|
759
|
+
'BD': 'Bangladesh',
|
|
760
|
+
'BE': 'Belgium',
|
|
761
|
+
'BF': 'Burkina Faso',
|
|
762
|
+
'BG': 'Bulgaria',
|
|
763
|
+
'BH': 'Bahrain',
|
|
764
|
+
'BI': 'Burundi',
|
|
765
|
+
'BJ': 'Benin',
|
|
766
|
+
'BL': 'Saint Barthélemy',
|
|
767
|
+
'BM': 'Bermuda',
|
|
768
|
+
'BN': 'Brunei Darussalam',
|
|
769
|
+
'BO': 'Bolivia',
|
|
770
|
+
'BQ-BO': 'Bonaire',
|
|
771
|
+
'BQ-SA': 'Saba',
|
|
772
|
+
'BQ-SE': 'Sint Eustatius',
|
|
773
|
+
'BR': 'Brazil',
|
|
774
|
+
'BS': 'Bahamas',
|
|
775
|
+
'BT': 'Bhutan',
|
|
776
|
+
'BV': 'Bouvet Island',
|
|
777
|
+
'BW': 'Botswana',
|
|
778
|
+
'BY': 'Belarus',
|
|
779
|
+
'BZ': 'Belize',
|
|
780
|
+
'CA': 'Canada',
|
|
781
|
+
'CC': 'Cocos (Keeling) Islands',
|
|
782
|
+
'CD': 'Democratic Republic of the Congo',
|
|
783
|
+
'CF': 'Central African Republic',
|
|
784
|
+
'CG': 'Republic of the Congo',
|
|
785
|
+
'CH': 'Switzerland',
|
|
786
|
+
'CI': 'Côte d\'Ivoire (Ivory Coast)',
|
|
787
|
+
'CK': 'Cook Islands',
|
|
788
|
+
'CL': 'Chile',
|
|
789
|
+
'CM': 'Cameroon',
|
|
790
|
+
'CN': 'China',
|
|
791
|
+
'CO': 'Colombia',
|
|
792
|
+
'CR': 'Costa Rica',
|
|
793
|
+
'CU': 'Cuba',
|
|
794
|
+
'CV': 'Cabo Verde',
|
|
795
|
+
'CW': 'Curaçao',
|
|
796
|
+
'CX': 'Christmas Island',
|
|
797
|
+
'CY': 'Cyprus',
|
|
798
|
+
'CZ': 'Czech Republic',
|
|
799
|
+
'DE': 'Germany',
|
|
800
|
+
'DJ': 'Djibouti',
|
|
801
|
+
'DK': 'Denmark',
|
|
802
|
+
'DM': 'Dominica',
|
|
803
|
+
'DO': 'Dominican Republic',
|
|
804
|
+
'DZ': 'Algeria',
|
|
805
|
+
'EC': 'Ecuador',
|
|
806
|
+
'EE': 'Estonia',
|
|
807
|
+
'EG': 'Egypt',
|
|
808
|
+
'EH': 'Western Sahara',
|
|
809
|
+
'ER': 'Eritrea',
|
|
810
|
+
'ES': 'Spain',
|
|
811
|
+
'ET': 'Ethiopia',
|
|
812
|
+
'FI': 'Finland',
|
|
813
|
+
'FJ': 'Fiji',
|
|
814
|
+
'FK': 'Falkland Islands',
|
|
815
|
+
'FM': 'Federated States of Micronesia',
|
|
816
|
+
'FO': 'Faroe Islands',
|
|
817
|
+
'FR': 'France',
|
|
818
|
+
'GA': 'Gabon',
|
|
819
|
+
'GB': 'England',
|
|
820
|
+
'GB-NIR': 'Northern Ireland',
|
|
821
|
+
'GB-SCT': 'Scotland',
|
|
822
|
+
'GB-UKM': 'United Kingdom',
|
|
823
|
+
'GB-WLS': 'Wales',
|
|
824
|
+
'GD': 'Grenada',
|
|
825
|
+
'GE': 'Georgia',
|
|
826
|
+
'GF': 'French Guiana',
|
|
827
|
+
'GG': 'Guernsey',
|
|
828
|
+
'GH': 'Ghana',
|
|
829
|
+
'GI': 'Gibraltar',
|
|
830
|
+
'GL': 'Greenland',
|
|
831
|
+
'GM': 'Gambia',
|
|
832
|
+
'GN': 'Guinea',
|
|
833
|
+
'GP': 'Guadeloupe',
|
|
834
|
+
'GP-FR': 'Guadeloupe',
|
|
835
|
+
'GQ': 'Equatorial Guinea',
|
|
836
|
+
'GR': 'Greece',
|
|
837
|
+
'GS': ' S. Georgia and S. Sandwich Islands',
|
|
838
|
+
'GT': 'Guatemala',
|
|
839
|
+
'GU': 'Guam',
|
|
840
|
+
'GW': 'Guinea-Bissau',
|
|
841
|
+
'GY': 'Guyana',
|
|
842
|
+
'HK': 'Hong Kong',
|
|
843
|
+
'HM': 'Heard and McDonald Islands',
|
|
844
|
+
'HN': 'Honduras',
|
|
845
|
+
'HR': 'Croatia (Hrvatska)',
|
|
846
|
+
'HT': 'Haiti',
|
|
847
|
+
'HU': 'Hungary',
|
|
848
|
+
'ID': 'Indonesia',
|
|
849
|
+
'IE': 'Ireland',
|
|
850
|
+
'IL': 'Isreal',
|
|
851
|
+
'IM': 'Isle of Man',
|
|
852
|
+
'IN': 'India',
|
|
853
|
+
'IO': 'British Indian Ocean Territory',
|
|
854
|
+
'IQ': 'Iraq',
|
|
855
|
+
'IR': 'Iran',
|
|
856
|
+
'IS': 'Iceland',
|
|
857
|
+
'IT': 'Italy',
|
|
858
|
+
'JE': 'Jersey',
|
|
859
|
+
'JM': 'Jamaica',
|
|
860
|
+
'JO': 'Jordan',
|
|
861
|
+
'JP': 'Japan',
|
|
862
|
+
'KE': 'Kenya',
|
|
863
|
+
'KG': 'Kyrgyzstan',
|
|
864
|
+
'KH': 'Cambodia',
|
|
865
|
+
'KI': ' Kiribati',
|
|
866
|
+
'KM': 'Comors',
|
|
867
|
+
'KN': 'Saint Kitts and Nevis',
|
|
868
|
+
'KP': 'Korea (North)',
|
|
869
|
+
'KR': 'Korea (South)',
|
|
870
|
+
'KW': 'Kuwait',
|
|
871
|
+
'KY': 'Cayman Islands',
|
|
872
|
+
'KZ': 'Kazakhstan',
|
|
873
|
+
'LA': 'Laos',
|
|
874
|
+
'LB': 'Lebanon',
|
|
875
|
+
'LC': 'Saint Lucia',
|
|
876
|
+
'LI': 'Liechtenstein',
|
|
877
|
+
'LK': 'Sri Lanka',
|
|
878
|
+
'LR': 'Liberia',
|
|
879
|
+
'LS': 'Lesotho',
|
|
880
|
+
'LT': 'Lithuania',
|
|
881
|
+
'LU': 'Luxembourg',
|
|
882
|
+
'LV': 'Latvia',
|
|
883
|
+
'LY': 'Libya',
|
|
884
|
+
'MA': 'Morocco',
|
|
885
|
+
'MC': 'Monaco',
|
|
886
|
+
'MD': 'Moldova',
|
|
887
|
+
'ME': 'Montenegro',
|
|
888
|
+
'MF': 'Saint Martin',
|
|
889
|
+
'MG': 'Madagascar',
|
|
890
|
+
'MH': 'Marshall Islands',
|
|
891
|
+
'MK': 'North Macedonia',
|
|
892
|
+
'ML': 'Mali',
|
|
893
|
+
'MM': 'Myanmar',
|
|
894
|
+
'MN': 'Mongolia',
|
|
895
|
+
'MO': 'Macao',
|
|
896
|
+
'MP': 'Northern Mariana Islands',
|
|
897
|
+
'MQ': 'Martinique',
|
|
898
|
+
'MQ-FR': 'Martinique',
|
|
899
|
+
'MR': 'Mauritania',
|
|
900
|
+
'MS': 'Montserrat',
|
|
901
|
+
'MT': 'Malta',
|
|
902
|
+
'MU': 'Mauritius',
|
|
903
|
+
'MV': 'Maldives',
|
|
904
|
+
'MW': 'Malawi',
|
|
905
|
+
'MX': 'Mexico',
|
|
906
|
+
'MY': 'Malaysia',
|
|
907
|
+
'MZ': 'Mozambique',
|
|
908
|
+
'NA': 'Namibia',
|
|
909
|
+
'NC': 'New Caledonia',
|
|
910
|
+
'NE': 'Niger',
|
|
911
|
+
'NF': 'Norfolk Island',
|
|
912
|
+
'NG': 'Nigeria',
|
|
913
|
+
'NI': 'Nicaragua',
|
|
914
|
+
'NL': 'Netherlands',
|
|
915
|
+
'NO': 'Norway',
|
|
916
|
+
'NP': 'Nepal',
|
|
917
|
+
'NR': 'Nauru',
|
|
918
|
+
'NU': 'Niue',
|
|
919
|
+
'NZ': 'New Zealand (Aotearoa)',
|
|
920
|
+
'OM': 'Oman',
|
|
921
|
+
'PA': 'Panama',
|
|
922
|
+
'PE': 'Peru',
|
|
923
|
+
'PF': 'French Polynesia',
|
|
924
|
+
'PG': 'Papua New Guinea',
|
|
925
|
+
'PH': 'Philippines',
|
|
926
|
+
'PK': 'Pakistan',
|
|
927
|
+
'PL': 'Poland',
|
|
928
|
+
'PM': 'St. Pierre & z',
|
|
929
|
+
'PM-FR': 'Saint Pierre and Miquelon',
|
|
930
|
+
'PN': 'Pitcairn Islands',
|
|
931
|
+
'PR': 'Puerto Rico',
|
|
932
|
+
'PS': 'Palestinian Territory',
|
|
933
|
+
'PT': 'Portugal',
|
|
934
|
+
'PW': 'Palau',
|
|
935
|
+
'PY': 'Paraguay',
|
|
936
|
+
'QA': 'Qatar',
|
|
937
|
+
'RE': 'Reunion',
|
|
938
|
+
'RO': 'Romania',
|
|
939
|
+
'RS': 'Serbia',
|
|
940
|
+
'RU': 'Russian Federation',
|
|
941
|
+
'RW': 'Rwanda',
|
|
942
|
+
'SA': 'Saudi Arabia',
|
|
943
|
+
'SB': 'Solomon Islands',
|
|
944
|
+
'SC': 'Seychelles',
|
|
945
|
+
'SD': 'Sudan',
|
|
946
|
+
'SE': 'Sweden',
|
|
947
|
+
'SG': 'Singapore',
|
|
948
|
+
'SH': 'Saint Helena',
|
|
949
|
+
'SI': 'Slovenia',
|
|
950
|
+
'SJ': 'Svalbard and Jan Mayen',
|
|
951
|
+
'SK': 'Slovakia',
|
|
952
|
+
'SL': 'Sierra Leone',
|
|
953
|
+
'SM': 'San Marino',
|
|
954
|
+
'SN': 'Senegal',
|
|
955
|
+
'SO': 'Somalia',
|
|
956
|
+
'SR': 'Suriname',
|
|
957
|
+
'SS': 'South Sudan',
|
|
958
|
+
'ST': 'Sao Tome and Principe',
|
|
959
|
+
'SV': 'El Salvador',
|
|
960
|
+
'SX': 'Sint Maarten',
|
|
961
|
+
'SY': 'Syria',
|
|
962
|
+
'SZ': 'Swaziland',
|
|
963
|
+
'TC': 'Turks and Caicos Islands',
|
|
964
|
+
'TD': 'Chad',
|
|
965
|
+
'TF': 'French Southern and Antarctic Lands',
|
|
966
|
+
'TG': 'Togo',
|
|
967
|
+
'TH': 'Thailand',
|
|
968
|
+
'TJ': 'Tajikistan',
|
|
969
|
+
'TK': 'Tokelau',
|
|
970
|
+
'TL': 'Timor-Leste',
|
|
971
|
+
'TM': 'Turkmenistan',
|
|
972
|
+
'TN': 'Tunisia',
|
|
973
|
+
'TO': 'Tonga',
|
|
974
|
+
'TR': 'Turkey',
|
|
975
|
+
'TT': 'Trinidad and Tobago',
|
|
976
|
+
'TV': 'Tuvalu',
|
|
977
|
+
'TW': 'Taiwan',
|
|
978
|
+
'TZ': 'Tanzania',
|
|
979
|
+
'UA': 'Ukraine',
|
|
980
|
+
'UG': 'Uganda',
|
|
981
|
+
'UM': 'United States Minor Outlying Islands',
|
|
982
|
+
'US': 'United States',
|
|
983
|
+
'UY': 'Uruguay',
|
|
984
|
+
'UZ': 'Uzbekistan',
|
|
985
|
+
'VA': 'Vatican City State',
|
|
986
|
+
'VC': 'Saint Vincent and the Grenadines',
|
|
987
|
+
'VE': 'Venezuela',
|
|
988
|
+
'VG': 'Virgin Islands (British)',
|
|
989
|
+
'VI': 'Virgin Islands (U.S.)',
|
|
990
|
+
'VN': 'Vietnam',
|
|
991
|
+
'VU': 'Vanuatu',
|
|
992
|
+
'WF': 'Wallis and Futuna',
|
|
993
|
+
'WS': 'Samoa',
|
|
994
|
+
'YE': 'Yemen',
|
|
995
|
+
'YT-UNF': 'Mayotte',
|
|
996
|
+
'ZA': 'South Africa',
|
|
997
|
+
'ZM': 'Zambia',
|
|
998
|
+
'ZW': 'Zimbabwe',
|
|
999
|
+
}
|