@chotot/clad-ui 3.0.0-next.2 → 3.0.0-next.4
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/CHANGELOG.md +675 -0
- package/README.md +173 -131
- package/dist/brand/ChototLogoText.d.ts +5 -0
- package/dist/brand/CtC2C.d.ts +5 -0
- package/dist/brand/CtProperty.d.ts +5 -0
- package/dist/brand/CtVehicle.d.ts +5 -0
- package/dist/brand/Tot.d.ts +5 -0
- package/dist/brand/index.d.ts +5 -0
- package/dist/chunk-Bmb41Sf3.cjs +1 -0
- package/dist/clad-ui.cjs +2 -0
- package/dist/clad-ui.d.ts +2 -0
- package/dist/clad-ui.es.js +9000 -4224
- package/dist/components/Announcer/Announcer.d.ts +3 -54
- package/dist/components/Announcer/announcer.styles.d.ts +39 -0
- package/dist/components/Announcer/index.d.ts +2 -0
- package/dist/components/Announcer/types.d.ts +41 -0
- package/dist/components/Badge/Badge.d.ts +2 -44
- package/dist/components/Badge/badge.styles.d.ts +57 -0
- package/dist/components/Badge/index.d.ts +4 -0
- package/dist/components/Badge/types.d.ts +33 -0
- package/dist/components/Box/Box.d.ts +7 -99
- package/dist/components/Box/index.d.ts +2 -0
- package/dist/components/Box/types.d.ts +89 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts +3 -5
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -17
- package/dist/components/Breadcrumbs/breadcrumbs.styles.d.ts +2 -0
- package/dist/components/Breadcrumbs/index.d.ts +3 -0
- package/dist/components/Breadcrumbs/types.d.ts +18 -0
- package/dist/components/Button/Button.d.ts +3 -76
- package/dist/components/Button/ButtonLink.d.ts +2 -3
- package/dist/components/Button/GhostButton.d.ts +3 -47
- package/dist/components/Button/IconButton.d.ts +2 -10
- package/dist/components/Button/button.styles.d.ts +242 -0
- package/dist/components/Button/constant.d.ts +1 -2
- package/dist/components/Button/index.d.ts +5 -0
- package/dist/components/Button/types.d.ts +72 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -46
- package/dist/components/Checkbox/checkbox.styles.d.ts +27 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/types.d.ts +40 -0
- package/dist/components/Chip/Chip.d.ts +3 -70
- package/dist/components/Chip/chip.styles.d.ts +66 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Chip/types.d.ts +22 -0
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +3 -39
- package/dist/components/CurrencyInput/currency-input.styles.d.ts +21 -0
- package/dist/components/CurrencyInput/index.d.ts +5 -0
- package/dist/components/CurrencyInput/types.d.ts +96 -0
- package/dist/components/CurrencyInput/utils.d.ts +18 -0
- package/dist/components/DatePicker/DatePicker.d.ts +2 -138
- package/dist/components/DatePicker/DateTimePicker.d.ts +2 -137
- package/dist/components/DatePicker/date-picker.styles.d.ts +9 -0
- package/dist/components/DatePicker/date-time-picker.styles.d.ts +10 -0
- package/dist/components/DatePicker/index.d.ts +4 -0
- package/dist/components/DatePicker/types.d.ts +286 -0
- package/dist/components/Drawer/Drawer.d.ts +36 -0
- package/dist/components/Drawer/Drawer.pw.fixtures.d.ts +9 -0
- package/dist/components/Drawer/index.d.ts +3 -0
- package/dist/components/Drawer/types.d.ts +191 -0
- package/dist/components/Dropdown/Dropdown.d.ts +3 -94
- package/dist/components/Dropdown/dropdown.styles.d.ts +18 -0
- package/dist/components/Dropdown/index.d.ts +4 -0
- package/dist/components/Dropdown/types.d.ts +89 -0
- package/dist/components/EmptyState/EmptyState.d.ts +4 -0
- package/dist/components/EmptyState/empty-state.styles.d.ts +3 -0
- package/dist/components/EmptyState/index.d.ts +2 -0
- package/dist/components/EmptyState/types.d.ts +55 -0
- package/dist/components/Grid/Col.d.ts +4 -35
- package/dist/components/Grid/Grid.d.ts +8 -55
- package/dist/components/Grid/Grid.pw.fixtures.d.ts +3 -0
- package/dist/components/Grid/index.d.ts +3 -0
- package/dist/components/Grid/types.d.ts +66 -0
- package/dist/components/Input/Input.d.ts +3 -116
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/input.styles.d.ts +24 -0
- package/dist/components/Input/types.d.ts +55 -0
- package/dist/components/InputGroup/InputGroup.d.ts +4 -0
- package/dist/components/InputGroup/index.d.ts +4 -0
- package/dist/components/InputGroup/input-group.styles.d.ts +18 -0
- package/dist/components/InputGroup/types.d.ts +20 -0
- package/dist/components/LegacyDialog/DialogMainIcon.d.ts +3 -0
- package/dist/components/LegacyDialog/LegacyDialog.d.ts +5 -0
- package/dist/components/LegacyDialog/index.d.ts +3 -0
- package/dist/{patterns/LegacyDialog/LegacyDialog.d.ts → components/LegacyDialog/types.d.ts} +2 -10
- package/dist/components/LegacyPopup/LegacyPopup.d.ts +6 -0
- package/dist/components/LegacyPopup/index.d.ts +2 -0
- package/dist/{patterns/LegacyPopup/LegacyPopup.d.ts → components/LegacyPopup/types.d.ts} +4 -15
- package/dist/components/MultiSearchDropdown/MultiSearchDropdown.d.ts +10 -0
- package/dist/components/MultiSearchDropdown/index.d.ts +4 -0
- package/dist/components/MultiSearchDropdown/multi-search-dropdown.styles.d.ts +18 -0
- package/dist/{patterns/MultiSearchDropdown/MultiSearchDropdown.d.ts → components/MultiSearchDropdown/types.d.ts} +6 -19
- package/dist/components/Pagination/PageItem.d.ts +3 -21
- package/dist/components/Pagination/Pagination.d.ts +2 -46
- package/dist/components/Pagination/index.d.ts +5 -0
- package/dist/components/Pagination/pagination.styles.d.ts +37 -0
- package/dist/components/Pagination/types.d.ts +66 -0
- package/dist/components/Popover/Popover.d.ts +4 -44
- package/dist/components/Popover/Popover.pw.fixtures.d.ts +6 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Popover/popover.styles.d.ts +1 -0
- package/dist/components/Popover/types.d.ts +44 -0
- package/dist/components/Popup/Popup.d.ts +31 -0
- package/dist/components/Popup/Popup.pw.fixtures.d.ts +5 -0
- package/dist/components/Popup/index.d.ts +3 -0
- package/dist/components/Popup/types.d.ts +145 -0
- package/dist/components/RadioButton/RadioButton.d.ts +3 -51
- package/dist/components/RadioButton/index.d.ts +4 -0
- package/dist/components/RadioButton/radio-button.styles.d.ts +27 -0
- package/dist/components/RadioButton/types.d.ts +46 -0
- package/dist/components/RangeInput/RangeInput.d.ts +4 -0
- package/dist/components/RangeInput/index.d.ts +3 -0
- package/dist/components/RangeInput/range-input.styles.d.ts +1 -0
- package/dist/{patterns/RangeInput/RangeInput.d.ts → components/RangeInput/types.d.ts} +1 -4
- package/dist/components/RowItem/RowItem.d.ts +8 -76
- package/dist/components/RowItem/index.d.ts +2 -0
- package/dist/components/RowItem/rowitem.styles.d.ts +36 -0
- package/dist/components/RowItem/types.d.ts +66 -0
- package/dist/components/SearchInput/SearchInput.d.ts +5 -0
- package/dist/components/SearchInput/index.d.ts +3 -0
- package/dist/components/SearchInput/search-input.styles.d.ts +18 -0
- package/dist/{patterns/SearchInput/SearchInput.d.ts → components/SearchInput/types.d.ts} +19 -25
- package/dist/components/Searchbar/Searchbar.d.ts +3 -0
- package/dist/components/Searchbar/index.d.ts +3 -0
- package/dist/components/Searchbar/searchbar.styles.d.ts +1 -0
- package/dist/{patterns/Searchbar/Searchbar.d.ts → components/Searchbar/types.d.ts} +6 -9
- package/dist/components/ShapeIcon/ShapeIcon.d.ts +3 -53
- package/dist/components/ShapeIcon/index.d.ts +2 -0
- package/dist/components/ShapeIcon/shape-icon.styles.d.ts +156 -0
- package/dist/components/ShapeIcon/types.d.ts +5 -0
- package/dist/components/Slider/Slider.d.ts +3 -57
- package/dist/components/Slider/index.d.ts +3 -0
- package/dist/components/Slider/slider.styles.d.ts +1 -0
- package/dist/components/Slider/types.d.ts +59 -0
- package/dist/components/Snack/Snack.d.ts +4 -48
- package/dist/components/Snack/index.d.ts +3 -0
- package/dist/components/Snack/snack.styles.d.ts +21 -0
- package/dist/components/Snack/types.d.ts +48 -0
- package/dist/components/Tabs/Tab.d.ts +3 -67
- package/dist/components/Tabs/Tabs.d.ts +14 -61
- package/dist/components/Tabs/index.d.ts +4 -0
- package/dist/components/Tabs/tabs.styles.d.ts +59 -0
- package/dist/components/Tabs/types.d.ts +97 -0
- package/dist/components/TagCloud/TagCloud.d.ts +11 -0
- package/dist/components/TagCloud/index.d.ts +2 -0
- package/dist/components/TagCloud/tagcloud.styles.d.ts +18 -0
- package/dist/components/TagCloud/types.d.ts +26 -0
- package/dist/components/TextArea/TextArea.d.ts +3 -100
- package/dist/components/TextArea/index.d.ts +4 -0
- package/dist/components/TextArea/text-area.styles.d.ts +21 -0
- package/dist/components/TextArea/types.d.ts +98 -0
- package/dist/components/TextLabel/TextLabel.d.ts +3 -35
- package/dist/components/TextLabel/index.d.ts +2 -0
- package/dist/components/TextLabel/textlabel.styles.d.ts +51 -0
- package/dist/components/TextLabel/types.d.ts +32 -0
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +3 -41
- package/dist/components/ToggleSwitch/index.d.ts +4 -0
- package/dist/components/ToggleSwitch/toggle-switch.styles.d.ts +39 -0
- package/dist/components/ToggleSwitch/types.d.ts +33 -0
- package/dist/components/Tooltip/Tooltip.d.ts +4 -98
- package/dist/components/Tooltip/Tooltip.pw.fixtures.d.ts +1 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tooltip/tooltip.styles.d.ts +18 -0
- package/dist/components/Tooltip/types.d.ts +24 -0
- package/dist/forge/index.cjs +0 -0
- package/dist/forge/index.d.ts +8 -0
- package/dist/forge/index.es.js +0 -0
- package/dist/icons.cjs +1 -0
- package/dist/icons.d.ts +1 -0
- package/dist/icons.es.js +1 -0
- package/dist/index.d.ts +82 -71
- package/dist/styles.css +2 -0
- package/dist/{utils/types.d.ts → types/index.d.ts} +0 -1
- package/dist/typography/BodyAnnotation.d.ts +8 -6
- package/dist/typography/BodyCaption.d.ts +8 -6
- package/dist/typography/BodyPage.d.ts +8 -6
- package/dist/typography/BodySection.d.ts +8 -6
- package/dist/typography/DisplayAnnotation.d.ts +8 -6
- package/dist/typography/DisplayCaption.d.ts +8 -6
- package/dist/typography/DisplayPage.d.ts +8 -6
- package/dist/typography/DisplayPrice.d.ts +21 -0
- package/dist/typography/DisplaySection.d.ts +8 -6
- package/dist/typography/HeaderAnnotation.d.ts +8 -6
- package/dist/typography/HeaderCaption.d.ts +8 -6
- package/dist/typography/HeaderPage.d.ts +8 -6
- package/dist/typography/HeaderSection.d.ts +8 -6
- package/dist/typography/LabelAnnotation.d.ts +8 -6
- package/dist/typography/LabelCaption.d.ts +8 -6
- package/dist/typography/LabelPage.d.ts +8 -6
- package/dist/typography/LabelSection.d.ts +8 -6
- package/dist/typography/NoteCaption.d.ts +8 -6
- package/dist/typography/NotePage.d.ts +8 -6
- package/dist/typography/NoteSection.d.ts +8 -6
- package/dist/typography/TaglineAnnotation.d.ts +8 -6
- package/dist/typography/TaglineCaption.d.ts +8 -6
- package/dist/typography/TaglineFootext.d.ts +8 -6
- package/dist/typography/TaglineSection.d.ts +8 -6
- package/dist/typography/index.d.ts +25 -24
- package/dist/utils/_inlineCreatePortal.d.ts +0 -1
- package/dist/utils/bundleCss.cjs +1 -0
- package/dist/utils/bundleCss.d.ts +6 -0
- package/dist/utils/bundleCss.es.js +18 -0
- package/dist/utils/cleanHtml.d.ts +4 -7
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/createUniversalPortal.d.ts +4 -14
- package/dist/utils/floating.d.ts +52 -0
- package/dist/utils/getBreakpointsValues.d.ts +4 -9
- package/dist/utils/sizes.d.ts +28 -0
- package/dist/utils/storyStyles.d.ts +21 -0
- package/dist/utils/themeTokens.d.ts +327 -0
- package/dist/utils/{scrollLock/useBodyScrollLock.d.ts → useBodyScrollLock.d.ts} +0 -1
- package/dist/utils/useScrollTop.d.ts +8 -0
- package/package.json +99 -99
- package/scripts/postinstall.cjs +180 -0
- package/skills/clad-ui/SKILL.md +109 -0
- package/skills/clad-ui/agents/openai.yaml +4 -0
- package/skills/clad-ui/references/components-display-layout.md +295 -0
- package/skills/clad-ui/references/components-inputs.md +449 -0
- package/skills/clad-ui/references/components-overlays-nav.md +314 -0
- package/skills/clad-ui/references/tokens.md +134 -0
- package/skills/clad-ui-feedback/SKILL.md +128 -0
- package/skills/migrate-clad-ui-v3/SKILL.md +123 -0
- package/skills/migrate-clad-ui-v3/agents/openai.yaml +4 -0
- package/skills/migrate-clad-ui-v3/references/component-api-changes.md +139 -0
- package/skills/migrate-clad-ui-v3/references/token-and-linaria-mapping.md +186 -0
- package/src/styles/base/base.css +440 -0
- package/src/styles/components/announcer.css +182 -0
- package/src/styles/components/badge.css +102 -0
- package/src/styles/components/box.css +61 -0
- package/src/styles/components/breadcrumbs.css +75 -0
- package/src/styles/components/button.css +527 -0
- package/src/styles/components/checkbox.css +115 -0
- package/src/styles/components/chip.css +155 -0
- package/src/styles/components/currency-input.css +146 -0
- package/src/styles/components/date-picker.css +305 -0
- package/src/styles/components/date-time-picker.css +64 -0
- package/src/styles/components/drawer.css +496 -0
- package/src/styles/components/dropdown.css +186 -0
- package/src/styles/components/empty-state.css +30 -0
- package/src/styles/components/grid.css +212 -0
- package/src/styles/components/index.css +36 -0
- package/src/styles/components/input-group.css +85 -0
- package/src/styles/components/input.css +255 -0
- package/src/styles/components/legacy-dialog.css +129 -0
- package/src/styles/components/legacy-popup.css +209 -0
- package/src/styles/components/multi-search-dropdown.css +240 -0
- package/src/styles/components/pagination.css +68 -0
- package/src/styles/components/popover.css +8 -0
- package/src/styles/components/popup.css +331 -0
- package/src/styles/components/radio-button.css +130 -0
- package/src/styles/components/range-input.css +40 -0
- package/src/styles/components/rowitem.css +75 -0
- package/src/styles/components/search-input.css +89 -0
- package/src/styles/components/searchbar.css +46 -0
- package/src/styles/components/shape-icon.css +199 -0
- package/src/styles/components/slider.css +232 -0
- package/src/styles/components/snack.css +144 -0
- package/src/styles/components/tabs.css +128 -0
- package/src/styles/components/tagcloud.css +50 -0
- package/src/styles/components/text-area.css +176 -0
- package/src/styles/components/textlabel.css +75 -0
- package/src/styles/components/toggle-switch.css +147 -0
- package/src/styles/components/tooltip.css +93 -0
- package/src/styles/index.css +10 -0
- package/src/styles/preset.css +6 -0
- package/src/styles/theme/colors/base.css +108 -0
- package/src/styles/theme/colors/semantic.css +135 -0
- package/src/styles/theme/index.css +57 -0
- package/src/styles/theme/typography/base.css +53 -0
- package/src/styles/theme/typography/semantic.css +176 -0
- package/src/styles/theme/variables.css +83 -0
- package/dist/components/Announcer/Announcer.d.ts.map +0 -1
- package/dist/components/Announcer/Announcer.styles.d.ts +0 -30
- package/dist/components/Announcer/Announcer.styles.d.ts.map +0 -1
- package/dist/components/Badge/Badge.d.ts.map +0 -1
- package/dist/components/Badge/Badge.styles.d.ts +0 -26
- package/dist/components/Badge/Badge.styles.d.ts.map +0 -1
- package/dist/components/Box/Box.d.ts.map +0 -1
- package/dist/components/Box/Box.styles.d.ts +0 -21
- package/dist/components/Box/Box.styles.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.styles.d.ts +0 -10
- package/dist/components/Breadcrumbs/Breadcrumbs.styles.d.ts.map +0 -1
- package/dist/components/Button/Button.d.ts.map +0 -1
- package/dist/components/Button/Button.styles.d.ts +0 -3
- package/dist/components/Button/Button.styles.d.ts.map +0 -1
- package/dist/components/Button/ButtonLink.d.ts.map +0 -1
- package/dist/components/Button/GhostButton.d.ts.map +0 -1
- package/dist/components/Button/GhostButton.styles.d.ts +0 -3
- package/dist/components/Button/GhostButton.styles.d.ts.map +0 -1
- package/dist/components/Button/IconButton.d.ts.map +0 -1
- package/dist/components/Button/constant.d.ts.map +0 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +0 -1
- package/dist/components/Checkbox/Checkbox.styles.d.ts +0 -5
- package/dist/components/Checkbox/Checkbox.styles.d.ts.map +0 -1
- package/dist/components/Chip/Chip.d.ts.map +0 -1
- package/dist/components/Chip/Chip.styles.d.ts +0 -13
- package/dist/components/Chip/Chip.styles.d.ts.map +0 -1
- package/dist/components/CurrencyInput/CurrencyInput.d.ts.map +0 -1
- package/dist/components/CurrencyInput/CurrencyInput.styles.d.ts +0 -27
- package/dist/components/CurrencyInput/CurrencyInput.styles.d.ts.map +0 -1
- package/dist/components/CurrencyInput/utils/_cleanValue.d.ts +0 -12
- package/dist/components/CurrencyInput/utils/_cleanValue.d.ts.map +0 -1
- package/dist/components/CurrencyInput/utils/_formatValue.d.ts +0 -6
- package/dist/components/CurrencyInput/utils/_formatValue.d.ts.map +0 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +0 -1
- package/dist/components/DatePicker/DateTimePicker.d.ts.map +0 -1
- package/dist/components/DatePicker/DateTimePicker.styles.d.ts +0 -61
- package/dist/components/DatePicker/DateTimePicker.styles.d.ts.map +0 -1
- package/dist/components/Dropdown/Dropdown.d.ts.map +0 -1
- package/dist/components/Dropdown/Dropdown.styles.d.ts +0 -11
- package/dist/components/Dropdown/Dropdown.styles.d.ts.map +0 -1
- package/dist/components/Grid/Col.d.ts.map +0 -1
- package/dist/components/Grid/Grid.d.ts.map +0 -1
- package/dist/components/Grid/Grid.styles.d.ts +0 -33
- package/dist/components/Grid/Grid.styles.d.ts.map +0 -1
- package/dist/components/Input/Input.d.ts.map +0 -1
- package/dist/components/Input/Input.styles.d.ts +0 -36
- package/dist/components/Input/Input.styles.d.ts.map +0 -1
- package/dist/components/Pagination/PageItem.d.ts.map +0 -1
- package/dist/components/Pagination/Pagination.d.ts.map +0 -1
- package/dist/components/Pagination/Pagination.style.d.ts +0 -7
- package/dist/components/Pagination/Pagination.style.d.ts.map +0 -1
- package/dist/components/Popover/Popover.d.ts.map +0 -1
- package/dist/components/Popover/Popover.styles.d.ts +0 -4
- package/dist/components/Popover/Popover.styles.d.ts.map +0 -1
- package/dist/components/RadioButton/RadioButton.d.ts.map +0 -1
- package/dist/components/RadioButton/RadioButton.styles.d.ts +0 -12
- package/dist/components/RadioButton/RadioButton.styles.d.ts.map +0 -1
- package/dist/components/RowItem/RowItem.d.ts.map +0 -1
- package/dist/components/RowItem/RowItem.styles.d.ts +0 -33
- package/dist/components/RowItem/RowItem.styles.d.ts.map +0 -1
- package/dist/components/ShapeIcon/ShapeIcon.d.ts.map +0 -1
- package/dist/components/ShapeIcon/ShapeIcon.styles.d.ts +0 -15
- package/dist/components/ShapeIcon/ShapeIcon.styles.d.ts.map +0 -1
- package/dist/components/Slider/Slider.d.ts.map +0 -1
- package/dist/components/Slider/Slider.styles.d.ts +0 -24
- package/dist/components/Slider/Slider.styles.d.ts.map +0 -1
- package/dist/components/Snack/Snack.d.ts.map +0 -1
- package/dist/components/Snack/Snack.styles.d.ts +0 -20
- package/dist/components/Snack/Snack.styles.d.ts.map +0 -1
- package/dist/components/Tabs/Tab.d.ts.map +0 -1
- package/dist/components/Tabs/Tabs.d.ts.map +0 -1
- package/dist/components/Tabs/Tabs.styles.d.ts +0 -43
- package/dist/components/Tabs/Tabs.styles.d.ts.map +0 -1
- package/dist/components/TextArea/TextArea.d.ts.map +0 -1
- package/dist/components/TextArea/TextArea.styles.d.ts +0 -19
- package/dist/components/TextArea/TextArea.styles.d.ts.map +0 -1
- package/dist/components/TextLabel/TextLabel.d.ts.map +0 -1
- package/dist/components/TextLabel/TextLabel.styles.d.ts +0 -10
- package/dist/components/TextLabel/TextLabel.styles.d.ts.map +0 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts.map +0 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.styles.d.ts +0 -22
- package/dist/components/ToggleSwitch/ToggleSwitch.styles.d.ts.map +0 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +0 -1
- package/dist/components/Tooltip/Tooltip.styles.d.ts +0 -33
- package/dist/components/Tooltip/Tooltip.styles.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -62
- package/dist/components/index.d.ts.map +0 -1
- package/dist/css/baseline.d.ts +0 -15
- package/dist/css/baseline.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/patterns/Drawer/Drawer.d.ts +0 -110
- package/dist/patterns/Drawer/Drawer.d.ts.map +0 -1
- package/dist/patterns/Drawer/Drawer.styles.d.ts +0 -39
- package/dist/patterns/Drawer/Drawer.styles.d.ts.map +0 -1
- package/dist/patterns/EmptyState/EmptyState.d.ts +0 -36
- package/dist/patterns/EmptyState/EmptyState.d.ts.map +0 -1
- package/dist/patterns/EmptyState/EmptyState.styles.d.ts +0 -4
- package/dist/patterns/EmptyState/EmptyState.styles.d.ts.map +0 -1
- package/dist/patterns/InputGroup/InputGroup.d.ts +0 -26
- package/dist/patterns/InputGroup/InputGroup.d.ts.map +0 -1
- package/dist/patterns/InputGroup/InputGroup.styles.d.ts +0 -8
- package/dist/patterns/InputGroup/InputGroup.styles.d.ts.map +0 -1
- package/dist/patterns/LegacyDialog/DialogMainIcon.d.ts +0 -2
- package/dist/patterns/LegacyDialog/DialogMainIcon.d.ts.map +0 -1
- package/dist/patterns/LegacyDialog/LegacyDialog.d.ts.map +0 -1
- package/dist/patterns/LegacyDialog/LegacyDialog.styles.d.ts +0 -13
- package/dist/patterns/LegacyDialog/LegacyDialog.styles.d.ts.map +0 -1
- package/dist/patterns/LegacyPopup/LegacyPopup.d.ts.map +0 -1
- package/dist/patterns/LegacyPopup/LegacyPopup.styles.d.ts +0 -27
- package/dist/patterns/LegacyPopup/LegacyPopup.styles.d.ts.map +0 -1
- package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.d.ts.map +0 -1
- package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.styles.d.ts +0 -26
- package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.styles.d.ts.map +0 -1
- package/dist/patterns/Popup/Popup.d.ts +0 -92
- package/dist/patterns/Popup/Popup.d.ts.map +0 -1
- package/dist/patterns/Popup/Popup.styles.d.ts +0 -41
- package/dist/patterns/Popup/Popup.styles.d.ts.map +0 -1
- package/dist/patterns/RangeInput/RangeInput.d.ts.map +0 -1
- package/dist/patterns/RangeInput/RangeInput.styles.d.ts +0 -5
- package/dist/patterns/RangeInput/RangeInput.styles.d.ts.map +0 -1
- package/dist/patterns/SearchInput/SearchInput.d.ts.map +0 -1
- package/dist/patterns/SearchInput/SearchInput.styles.d.ts +0 -10
- package/dist/patterns/SearchInput/SearchInput.styles.d.ts.map +0 -1
- package/dist/patterns/Searchbar/Searchbar.d.ts.map +0 -1
- package/dist/patterns/Searchbar/Searchbar.styles.d.ts +0 -3
- package/dist/patterns/Searchbar/Searchbar.styles.d.ts.map +0 -1
- package/dist/patterns/TagCloud/TagCloud.d.ts +0 -76
- package/dist/patterns/TagCloud/TagCloud.d.ts.map +0 -1
- package/dist/patterns/TagCloud/TagCloud.styles.d.ts +0 -15
- package/dist/patterns/TagCloud/TagCloud.styles.d.ts.map +0 -1
- package/dist/patterns/TagCloud/TagCloudMultiActive.d.ts +0 -25
- package/dist/patterns/TagCloud/TagCloudMultiActive.d.ts.map +0 -1
- package/dist/patterns/TagCloud/TagCloudSingleActive.d.ts +0 -22
- package/dist/patterns/TagCloud/TagCloudSingleActive.d.ts.map +0 -1
- package/dist/patterns/index.d.ts +0 -23
- package/dist/patterns/index.d.ts.map +0 -1
- package/dist/theme/chotot.d.ts +0 -1371
- package/dist/theme/chotot.d.ts.map +0 -1
- package/dist/theme/ct-job.d.ts +0 -826
- package/dist/theme/ct-job.d.ts.map +0 -1
- package/dist/theme/ct-pty.d.ts +0 -826
- package/dist/theme/ct-pty.d.ts.map +0 -1
- package/dist/theme/ct-veh.d.ts +0 -591
- package/dist/theme/ct-veh.d.ts.map +0 -1
- package/dist/theme/index.d.ts +0 -5
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/mudah.d.ts +0 -248
- package/dist/theme/mudah.d.ts.map +0 -1
- package/dist/theme/types.d.ts +0 -58
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme-chotot.css +0 -2
- package/dist/theme-job.css +0 -2
- package/dist/theme-pty.css +0 -2
- package/dist/theme-veh.css +0 -2
- package/dist/typography/BodyAnnotation.d.ts.map +0 -1
- package/dist/typography/BodyCaption.d.ts.map +0 -1
- package/dist/typography/BodyPage.d.ts.map +0 -1
- package/dist/typography/BodySection.d.ts.map +0 -1
- package/dist/typography/DisplayAnnotation.d.ts.map +0 -1
- package/dist/typography/DisplayCaption.d.ts.map +0 -1
- package/dist/typography/DisplayPage.d.ts.map +0 -1
- package/dist/typography/DisplaySection.d.ts.map +0 -1
- package/dist/typography/HeaderAnnotation.d.ts.map +0 -1
- package/dist/typography/HeaderCaption.d.ts.map +0 -1
- package/dist/typography/HeaderPage.d.ts.map +0 -1
- package/dist/typography/HeaderSection.d.ts.map +0 -1
- package/dist/typography/LabelAnnotation.d.ts.map +0 -1
- package/dist/typography/LabelCaption.d.ts.map +0 -1
- package/dist/typography/LabelPage.d.ts.map +0 -1
- package/dist/typography/LabelSection.d.ts.map +0 -1
- package/dist/typography/NoteCaption.d.ts.map +0 -1
- package/dist/typography/NotePage.d.ts.map +0 -1
- package/dist/typography/NoteSection.d.ts.map +0 -1
- package/dist/typography/TaglineAnnotation.d.ts.map +0 -1
- package/dist/typography/TaglineCaption.d.ts.map +0 -1
- package/dist/typography/TaglineFootext.d.ts.map +0 -1
- package/dist/typography/TaglineSection.d.ts.map +0 -1
- package/dist/typography/index.d.ts.map +0 -1
- package/dist/utils/_inlineCreatePortal.d.ts.map +0 -1
- package/dist/utils/_normalizeArrowKey.d.ts +0 -10
- package/dist/utils/_normalizeArrowKey.d.ts.map +0 -1
- package/dist/utils/_simulateChangeEvent.d.ts +0 -25
- package/dist/utils/_simulateChangeEvent.d.ts.map +0 -1
- package/dist/utils/cleanHtml.d.ts.map +0 -1
- package/dist/utils/createUniversalPortal.d.ts.map +0 -1
- package/dist/utils/cx.d.ts +0 -22
- package/dist/utils/cx.d.ts.map +0 -1
- package/dist/utils/getBreakpointsValues.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/noop.d.ts +0 -9
- package/dist/utils/noop.d.ts.map +0 -1
- package/dist/utils/scrollLock/index.d.ts +0 -7
- package/dist/utils/scrollLock/index.d.ts.map +0 -1
- package/dist/utils/scrollLock/scrollLock.styles.d.ts +0 -6
- package/dist/utils/scrollLock/scrollLock.styles.d.ts.map +0 -1
- package/dist/utils/scrollLock/useBodyScrollLock.d.ts.map +0 -1
- package/dist/utils/scrollTop.d.ts +0 -8
- package/dist/utils/scrollTop.d.ts.map +0 -1
- package/dist/utils/sx.d.ts +0 -174
- package/dist/utils/sx.d.ts.map +0 -1
- package/dist/utils/types.d.ts.map +0 -1
- package/theme/__snapshots__/chotot.spec.js.snap +0 -519
- package/theme/__snapshots__/mudah.spec.js.snap +0 -161
- package/theme/chotot.js +0 -1336
- package/theme/chotot.spec.js +0 -72
- package/theme/ct-job.js +0 -92
- package/theme/ct-pty.js +0 -92
- package/theme/ct-veh.js +0 -92
- package/theme/index.ts +0 -10
- package/theme/mudah.js +0 -333
- package/theme/mudah.spec.js +0 -9
- package/theme/types.ts +0 -61
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
# Clad UI Tailwind — Overlays, Feedback & Navigation Components
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- [1. Drawer (Compound & Legacy + Double-Header Gotcha)](#1-drawer-compound--legacy--double-header-gotcha)
|
|
6
|
+
- [2. Popup (Compound & Legacy)](#2-popup-compound--legacy)
|
|
7
|
+
- [3. Popover](#3-popover)
|
|
8
|
+
- [4. Tooltip](#4-tooltip)
|
|
9
|
+
- [5. Snack](#5-snack)
|
|
10
|
+
- [6. Announcer](#6-announcer)
|
|
11
|
+
- [7. Tabs & Tab](#7-tabs--tab)
|
|
12
|
+
- [8. Breadcrumbs & BreadcrumbItem](#8-breadcrumbs--breadcrumbitem)
|
|
13
|
+
- [9. Pagination & PageItem](#9-pagination--pageitem)
|
|
14
|
+
- [10. LegacyDialog & LegacyPopup](#10-legacydialog--legacypopup)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 1. Drawer (Compound & Legacy + Double-Header Gotcha)
|
|
19
|
+
|
|
20
|
+
Responsive overlay rendered via portal (`z-index: 1600`) with body scroll lock: bottom sheet on mobile (`<768px`, optional `halfHeight` + `dragHandle` pointer drag) and centered dialog on desktop (`>=768px`, `size`: `'S'` 480px, `'M'` 720px, `'L'` 1200px).
|
|
21
|
+
|
|
22
|
+
### Preferred Compound Pattern (`Drawer.*`)
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { Drawer, Button } from '@chotot/clad-ui';
|
|
26
|
+
import { Close } from '@chotot/clad-ui/icons';
|
|
27
|
+
|
|
28
|
+
<Drawer.Container open={isOpen} onClose={() => setIsOpen(false)} size="M" halfHeight dragHandle>
|
|
29
|
+
<Drawer.DragHandle />
|
|
30
|
+
<Drawer.Header
|
|
31
|
+
title="Chọn khu vực"
|
|
32
|
+
leading={<Drawer.HeaderItem type="icon" icon={<Close />} onClick={() => setIsOpen(false)} />}
|
|
33
|
+
trailing={<Drawer.HeaderItem type="textLink" text="Đặt lại" onClick={reset} />}
|
|
34
|
+
/>
|
|
35
|
+
<Drawer.Body>
|
|
36
|
+
<p className="text-body-section text-text-primary">Nội dung</p>
|
|
37
|
+
</Drawer.Body>
|
|
38
|
+
<Drawer.Button direction="horizontal">
|
|
39
|
+
<Button variant="tonal" color="neutral" onClick={() => setIsOpen(false)}>Hủy</Button>
|
|
40
|
+
<Button color="primary" onClick={apply}>Áp dụng</Button>
|
|
41
|
+
</Drawer.Button>
|
|
42
|
+
</Drawer.Container>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
| Sub-component / Prop | Type | Default |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| `Drawer.Container`: `open` | `boolean` | `false` |
|
|
48
|
+
| `Drawer.Container`: `onClose` | `MouseEventHandler<HTMLElement>` | — |
|
|
49
|
+
| `Drawer.Container`: `size` | `'S' \| 'M' \| 'L'` (desktop width: 480 / 720 / 1200px) | `'S'` |
|
|
50
|
+
| `Drawer.Container`: `halfHeight` | `boolean` (mobile starts at 50vh, expands on drag/scroll) | `false` |
|
|
51
|
+
| `Drawer.Container`: `dragHandle` | `boolean` | `false` |
|
|
52
|
+
| `Drawer.Container`: `needBypassScrollLock` | `boolean` | `false` |
|
|
53
|
+
| `Drawer.Header`: `title` / `leading` / `trailing` | `ReactNode` | — |
|
|
54
|
+
| `Drawer.HeaderItem`: `type` | `'icon' \| 'textLink'` (`icon` or `text`, `onClick`) | `'icon'` |
|
|
55
|
+
| `Drawer.Body`: `hideScrollbar` / `childrenOverflowVisible` | `boolean` | `false` |
|
|
56
|
+
| `Drawer.Button`: `direction` | `'horizontal' \| 'vertical'` | `'horizontal'` |
|
|
57
|
+
|
|
58
|
+
### Legacy Monolithic `<Drawer>` Props & Double-Header Gotcha
|
|
59
|
+
|
|
60
|
+
- **Gotcha 1 (`title` vs `isEmptyDrawer`):** `<Drawer title="...">` always renders a sticky header bar. If your child component already renders its own header (back button + title + close icon), pass `isEmptyDrawer` and omit `title` to avoid a double header:
|
|
61
|
+
```tsx
|
|
62
|
+
// Child owns header -> use isEmptyDrawer
|
|
63
|
+
<Drawer open={isOpen} onClose={onClose} isEmptyDrawer>
|
|
64
|
+
<CustomScreenWithOwnHeader onClose={onClose} />
|
|
65
|
+
</Drawer>
|
|
66
|
+
```
|
|
67
|
+
- **Legacy props on `<Drawer>`:** `title`, `img`, `primaryBtnLabel`, `secondaryBtnLabel`, `optionalBtnLabel`, `onPrimaryButtonClick`, `onSecondaryButtonClick`, `onOptionalBtnClick`, `primaryColor`, `actions`, `haveClose`, `isEmptyDrawer`, `contentClassName`.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 2. Popup (Compound & Legacy)
|
|
72
|
+
|
|
73
|
+
Centered modal dialog rendered via portal (`z-index: 1600`, `max-width: 480px`) with body scroll lock.
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import { Popup, Button } from '@chotot/clad-ui';
|
|
77
|
+
import { Close } from '@chotot/clad-ui/icons';
|
|
78
|
+
|
|
79
|
+
<Popup.Container open={isOpen} onClose={() => setIsOpen(false)}>
|
|
80
|
+
<Popup.Header
|
|
81
|
+
title="Xác nhận xóa"
|
|
82
|
+
trailing={<Popup.HeaderItem type="icon" icon={<Close />} onClick={() => setIsOpen(false)} />}
|
|
83
|
+
/>
|
|
84
|
+
<Popup.Body>
|
|
85
|
+
<p className="text-body-section text-text-secondary">Bạn có chắc chắn muốn xóa tin đăng này?</p>
|
|
86
|
+
</Popup.Body>
|
|
87
|
+
<Popup.Button direction="horizontal">
|
|
88
|
+
<Button variant="tonal" color="neutral" onClick={() => setIsOpen(false)}>Hủy</Button>
|
|
89
|
+
<Button color="error" onClick={confirmDelete}>Xóa</Button>
|
|
90
|
+
</Popup.Button>
|
|
91
|
+
</Popup.Container>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
| Sub-component / Prop | Type | Default |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| `Popup.Container`: `open`, `onClose`, `needBypassScrollLock`, `className` | Same as `Drawer.Container` (fixed 480px max-width) | — |
|
|
97
|
+
| `Popup.Header` / `Popup.HeaderItem` / `Popup.Body` / `Popup.Button` | Same slot contract as `Drawer.*` | — |
|
|
98
|
+
| Legacy `<Popup>` props | `title`, `img`, `imgSize` (`'sm' \| 'md' \| 'lg'`), `primaryBtnLabel`, `secondaryBtnLabel`, `btnGroupDirection` (`'row' \| 'column'`), `btnRowPosition`, `haveClose`, `primaryColor`, `secondaryColor`, `onPrimaryButtonClick`, `onSecondaryButtonClick` | — |
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 3. Popover
|
|
103
|
+
|
|
104
|
+
Floating portal layer anchored to `anchorEl` via `@floating-ui/react-dom` (`z-index: 1800`).
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
import { Popover } from '@chotot/clad-ui';
|
|
108
|
+
|
|
109
|
+
const anchorRef = useRef<HTMLButtonElement>(null);
|
|
110
|
+
<Popover
|
|
111
|
+
anchorEl={anchorRef}
|
|
112
|
+
open={isOpen}
|
|
113
|
+
placement="bottom-start"
|
|
114
|
+
offset={8}
|
|
115
|
+
onOutsideClick={() => setIsOpen(false)}
|
|
116
|
+
>
|
|
117
|
+
<div className="p-4">Nội dung popover</div>
|
|
118
|
+
</Popover>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
| Prop | Type | Default |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| `anchorEl` | `RefObject<HTMLElement \| null>` | required |
|
|
124
|
+
| `open` | `boolean` | `false` |
|
|
125
|
+
| `placement` | `PopoverPlacement` (`'top-start' \| 'top-center' \| 'top-end' \| 'bottom-start' \| 'bottom-center' \| 'bottom-end' \| 'left-*' \| 'right-*'`) | `'top-center'` |
|
|
126
|
+
| `autoPlacement` | `boolean` | `false` |
|
|
127
|
+
| `offset` | `number` (px) | `0` |
|
|
128
|
+
| `width` | `number` (px) | anchor width |
|
|
129
|
+
| `onOutsideClick` / `onOutsideHover` | `() => void` | — |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 4. Tooltip
|
|
134
|
+
|
|
135
|
+
Floating tooltip via `@floating-ui/react-dom` (`z-index: 1900`). Wraps a single trigger element as `children`.
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
import { Tooltip, Button } from '@chotot/clad-ui';
|
|
139
|
+
|
|
140
|
+
<>
|
|
141
|
+
<Tooltip variant="dark" text="Thông tin chi tiết" hoverable>
|
|
142
|
+
<span>Di chuột vào đây</span>
|
|
143
|
+
</Tooltip>
|
|
144
|
+
|
|
145
|
+
<Tooltip variant="light" title="Mẹo bán nhanh" text="Chụp ảnh rõ nét" thumbnail="/tip.png" haveClose onClose={fn}>
|
|
146
|
+
<Button>Xem mẹo</Button>
|
|
147
|
+
</Tooltip>
|
|
148
|
+
</>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
| Prop | Type | Default |
|
|
152
|
+
|---|---|---|
|
|
153
|
+
| `variant` | `'dark' \| 'light'` | `'dark'` |
|
|
154
|
+
| `text` / `dangerousHtml` / `title` / `thumbnail` | `string` | — |
|
|
155
|
+
| `haveClose` / `hoverable` / `manual` | `boolean` | `false` |
|
|
156
|
+
| `action` | `ReactNode` | — |
|
|
157
|
+
| `placement` | `TooltipPlacement` | `'bottom-center'` |
|
|
158
|
+
| `delayEnter` / `delayLeave` / `fadeDuration` | `TooltipDuration` | `'none'` / `'none'` / `'xs'` |
|
|
159
|
+
| `arrowOffset` / `triggerOffset` | `TooltipSpace` | `'xs'` / `'sm'` |
|
|
160
|
+
| `zIndex` / `maxWidth` | `number` / `string` | `1900` / `'280px'` |
|
|
161
|
+
| `onClose` | `() => void` | — |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 5. Snack
|
|
166
|
+
|
|
167
|
+
Fixed bottom toast notification rendered in a portal (`z-index: 1900`).
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
import { Snack } from '@chotot/clad-ui';
|
|
171
|
+
|
|
172
|
+
<Snack
|
|
173
|
+
desktopSize="lg"
|
|
174
|
+
autoHideDuration="xl"
|
|
175
|
+
haveClose
|
|
176
|
+
actionLabel="Hoàn tác"
|
|
177
|
+
onActionClick={undo}
|
|
178
|
+
onClose={() => setShow(false)}
|
|
179
|
+
>
|
|
180
|
+
Đã lưu tin đăng vào mục yêu thích.
|
|
181
|
+
</Snack>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
| Prop | Type | Default |
|
|
185
|
+
|---|---|---|
|
|
186
|
+
| `children` | `ReactNode` | required |
|
|
187
|
+
| `desktopSize` | `'md' \| 'lg' \| 'xl'` | `'lg'` |
|
|
188
|
+
| `autoHideDuration` | `'none' \| 'xxxs' \| 'xxs' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'xxl' \| 'xxxl' \| 'xxxxl'` | `'xl'` |
|
|
189
|
+
| `haveClose` | `boolean` | `false` |
|
|
190
|
+
| `actionLabel` | `string` | — |
|
|
191
|
+
| `onActionClick` | `MouseEventHandler<HTMLButtonElement>` | — |
|
|
192
|
+
| `onClose` | `() => void` | — |
|
|
193
|
+
| `icon` | `ReactNode` | — |
|
|
194
|
+
| `layout` | `'horizontal' \| 'vertical'` | `'horizontal'` |
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## 6. Announcer
|
|
199
|
+
|
|
200
|
+
Inline system message banner controlled by `open` (renders `null` when `open={false}`).
|
|
201
|
+
|
|
202
|
+
```tsx
|
|
203
|
+
import { Announcer } from '@chotot/clad-ui';
|
|
204
|
+
|
|
205
|
+
<Announcer
|
|
206
|
+
type="warning"
|
|
207
|
+
title="Cập nhật hệ thống"
|
|
208
|
+
btnLabel="Xem chi tiết"
|
|
209
|
+
open={isOpen}
|
|
210
|
+
onButtonClick={handleMore}
|
|
211
|
+
onClose={() => setIsOpen(false)}
|
|
212
|
+
>
|
|
213
|
+
Hệ thống sẽ bảo trì từ 00:00 đến 02:00.
|
|
214
|
+
</Announcer>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
| Prop | Type | Default |
|
|
218
|
+
|---|---|---|
|
|
219
|
+
| `open` | `boolean` | `false` |
|
|
220
|
+
| `type` | `'info' \| 'warning' \| 'success' \| 'error' \| 'neutral'` | `'info'` |
|
|
221
|
+
| `compact` | `boolean` — single-line truncated, hides title/action | `false` |
|
|
222
|
+
| `title` / `btnLabel` / `dangerousHtml` | `string` | — |
|
|
223
|
+
| `children` | `ReactNode` | — |
|
|
224
|
+
| `icon` | `ReactNode` — overrides default type icon | — |
|
|
225
|
+
| `isLoading` | `boolean` — renders skeleton loader | `false` |
|
|
226
|
+
| `onButtonClick` | `MouseEventHandler` | — |
|
|
227
|
+
| `onClose` | `() => void` (hides `×` button if omitted) | — |
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 7. Tabs & Tab
|
|
232
|
+
|
|
233
|
+
Horizontal tab bar with animated active indicator and optional scroll buttons.
|
|
234
|
+
|
|
235
|
+
```tsx
|
|
236
|
+
import { Tabs, Tab } from '@chotot/clad-ui';
|
|
237
|
+
|
|
238
|
+
<Tabs value={activeTab} onChange={(e, val) => setActiveTab(val)} variant="standard" showDivider>
|
|
239
|
+
<Tab value="all" label="Tất cả" />
|
|
240
|
+
<Tab value="active" label="Đang hiển thị" />
|
|
241
|
+
<Tab value="expired" label="Hết hạn" disabled />
|
|
242
|
+
</Tabs>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
| Component & Prop | Type | Default |
|
|
246
|
+
|---|---|---|
|
|
247
|
+
| `Tabs`: `value` | `number \| string` — active `Tab` value | — |
|
|
248
|
+
| `Tabs`: `onChange` | `(event: MouseEvent<HTMLElement>, value: number \| string) => void` | — |
|
|
249
|
+
| `Tabs`: `variant` | `'standard' \| 'fullWidth'` | `'standard'` |
|
|
250
|
+
| `Tabs`: `showDivider` / `showScrollBtn` | `boolean` | `false` |
|
|
251
|
+
| `Tabs`: `fontWeight` | `'bold' \| 'normal'` | `'bold'` |
|
|
252
|
+
| `Tabs`: `height` / `lineClamp` / `widthScroll` | `string` / `number` / `number` | — / `1` / — |
|
|
253
|
+
| `Tab`: `value` | `number \| string` | required |
|
|
254
|
+
| `Tab`: `label` | `string` | — |
|
|
255
|
+
| `Tab`: `icon` | `ReactElement` | — |
|
|
256
|
+
| `Tab`: `disabled` | `boolean` | `false` |
|
|
257
|
+
| `Tab`: `width` / `height` / `lineClamp` | `string` / `string` / `number` | — / — / `1` |
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## 8. Breadcrumbs & BreadcrumbItem
|
|
262
|
+
|
|
263
|
+
Schema.org `BreadcrumbList` trail (`<ol>`). The **last** `BreadcrumbItem` automatically renders as current-page text (`<span aria-current="page">`).
|
|
264
|
+
|
|
265
|
+
```tsx
|
|
266
|
+
import { Breadcrumbs, BreadcrumbItem } from '@chotot/clad-ui';
|
|
267
|
+
|
|
268
|
+
<Breadcrumbs>
|
|
269
|
+
<BreadcrumbItem href="/">Chợ Tốt</BreadcrumbItem>
|
|
270
|
+
<BreadcrumbItem href="/toan-quoc">Toàn quốc</BreadcrumbItem>
|
|
271
|
+
<BreadcrumbItem href="/toan-quoc/xe-may">Xe máy</BreadcrumbItem>
|
|
272
|
+
</Breadcrumbs>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
| Component & Prop | Type | Default |
|
|
276
|
+
|---|---|---|
|
|
277
|
+
| `Breadcrumbs`: `children` | `ReactNode` | required |
|
|
278
|
+
| `Breadcrumbs`: `isShow` | `boolean` (`false` renders a 16px height placeholder) | `true` |
|
|
279
|
+
| `BreadcrumbItem`: `as` | `ElementType` (e.g. Next.js `Link`) | `'a'` |
|
|
280
|
+
| `BreadcrumbItem`: `href` | `string` | — |
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## 9. Pagination & PageItem
|
|
285
|
+
|
|
286
|
+
Page navigation bar with automatic ellipsis truncation and polymorphic `PageItem`.
|
|
287
|
+
|
|
288
|
+
```tsx
|
|
289
|
+
import { Pagination, PageItem } from '@chotot/clad-ui';
|
|
290
|
+
|
|
291
|
+
<Pagination
|
|
292
|
+
currentPage={page}
|
|
293
|
+
totalPages={20}
|
|
294
|
+
onChange={(nextPage) => setPage(nextPage)}
|
|
295
|
+
renderPageItem={(props) => <PageItem {...props} as="a" href={`?page=${props.page}`} />}
|
|
296
|
+
/>
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
| Prop | Type | Default |
|
|
300
|
+
|---|---|---|
|
|
301
|
+
| `currentPage` | `number` | `1` |
|
|
302
|
+
| `totalPages` | `number` | required |
|
|
303
|
+
| `siblingCount` | `number` | `1` |
|
|
304
|
+
| `showActionButtons` | `boolean` | `true` |
|
|
305
|
+
| `onChange` | `(page: number) => void` | — |
|
|
306
|
+
| `onPreviousPage` / `onNextPage` | `() => void` | — |
|
|
307
|
+
| `renderPageItem` | `(props: PageItemProps) => ReactNode` | — |
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## 10. LegacyDialog & LegacyPopup
|
|
312
|
+
|
|
313
|
+
- `LegacyDialog` (`DialogMainIcon`) and `LegacyPopup` are exported for backward compatibility with v2 codebases.
|
|
314
|
+
- For all new UI, use `Popup` (`Popup.Container`) or `Drawer` (`Drawer.Container`).
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Clad UI Tailwind — Tokens, Typography & Themes
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- [1. Setup & Stylesheet Import](#1-setup--stylesheet-import)
|
|
6
|
+
- [2. Themes (`data-theme`)](#2-themes-data-theme)
|
|
7
|
+
- [3. Semantic Color Tokens](#3-semantic-color-tokens)
|
|
8
|
+
- [4. Interaction State Tokens](#4-interaction-state-tokens)
|
|
9
|
+
- [5. Typography Scale & Utilities](#5-typography-scale--utilities)
|
|
10
|
+
- [6. Spacing, Sizing & Border Radius](#6-spacing-sizing--border-radius)
|
|
11
|
+
- [7. Debug Mode](#7-debug-mode)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 1. Setup & Stylesheet Import
|
|
16
|
+
|
|
17
|
+
Import the stylesheet once at the root of the application (`_app.tsx` or `layout.tsx`):
|
|
18
|
+
|
|
19
|
+
- **Option A — Pre-compiled CSS (works with any bundler or Tailwind v3/v4):**
|
|
20
|
+
```tsx
|
|
21
|
+
import '@chotot/clad-ui/styles.css';
|
|
22
|
+
```
|
|
23
|
+
- **Option B — Tailwind CSS v4 source preset (exposes all `@utility` and `@theme` tokens to app classes, with Tailwind preflight omitted so Clad UI's `baseline.css` is not overridden):**
|
|
24
|
+
```css
|
|
25
|
+
@layer theme, base, components, utilities;
|
|
26
|
+
@import "tailwindcss/theme.css" layer(theme);
|
|
27
|
+
@import "tailwindcss/utilities.css" layer(utilities);
|
|
28
|
+
@import "@chotot/clad-ui/preset.css";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 2. Themes (`data-theme`)
|
|
34
|
+
|
|
35
|
+
Apply `data-theme` on `<html>`, `<body>`, or a scoped wrapper container. Semantic tokens (`bg-background-brand`, button colors, interaction states) adapt automatically without runtime JS context.
|
|
36
|
+
|
|
37
|
+
| Vertical / Brand | Attribute | Primary Brand Palette |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| Chợ Tốt (default) | *(none)* or `data-theme="chotot"` | Yellow (`#ffd400`) |
|
|
40
|
+
| Việc Làm Tốt | `data-theme="job"` | Blue |
|
|
41
|
+
| Nhà Tốt | `data-theme="pty"` | Orange |
|
|
42
|
+
| Chợ Tốt Xe | `data-theme="veh"` | Yellow |
|
|
43
|
+
|
|
44
|
+
> **Note:** Fixed Chợ Tốt identity tokens (`bg-background-chotot`, `text-text-chotot`, `text-icon-chotot`) stay Chợ Tốt yellow across all verticals. Use `-brand` tokens (`bg-background-brand`, `text-text-brand`) when the element should adapt to the active vertical theme.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 3. Semantic Color Tokens
|
|
49
|
+
|
|
50
|
+
Hierarchy: `Base Colors → Semantic Colors → Component Usage`. **Never** use raw Tailwind palette colors (`bg-gray-100`, `text-blue-500`) or arbitrary hex values (`bg-[#ffd400]`).
|
|
51
|
+
|
|
52
|
+
### Backgrounds (`bg-background-*` / `var(--color-background-*)`)
|
|
53
|
+
|
|
54
|
+
| Category | Utility Classes |
|
|
55
|
+
|---|---|
|
|
56
|
+
| Brand & Identity | `bg-background-brand`, `bg-background-brand-light`, `bg-background-brand-light-secondary`, `bg-background-chotot`, `bg-background-chotot-light`, `bg-background-appwrapper`, `bg-background-app` |
|
|
57
|
+
| Semantic States | `bg-background-info`, `bg-background-info-light`, `bg-background-success`, `bg-background-success-light`, `bg-background-error`, `bg-background-error-light`, `bg-background-warning`, `bg-background-warning-light` |
|
|
58
|
+
| Neutral Surfaces | `bg-background-primary` (white), `bg-background-secondary` (`gray50`), `bg-background-tertiary` (`gray75`), `bg-background-inverted` (`gray900`) |
|
|
59
|
+
| Disabled, Skeleton & Overlays | `bg-background-disabled` (alias `bg-background-disable`), `bg-skeleton-background`, `bg-skeleton-item`, `bg-background-overlay`, `bg-background-overlay-inverted` |
|
|
60
|
+
|
|
61
|
+
### Text (`text-text-*` / `var(--color-text-*)`)
|
|
62
|
+
|
|
63
|
+
| Category | Utility Classes |
|
|
64
|
+
|---|---|
|
|
65
|
+
| Neutral Hierarchy | `text-text-primary` (`gray900`), `text-text-secondary` (`gray600`), `text-text-tertiary` (`gray400`), `text-text-disabled` (`gray200`), `text-text-blank` (white) |
|
|
66
|
+
| Brand & Semantic | `text-text-brand`, `text-text-chotot`, `text-text-link`, `text-text-info`, `text-text-success`, `text-text-error`, `text-text-warning` |
|
|
67
|
+
| On-Surface / Overlay | `text-text-on-background` (high-contrast text on `bg-background-brand`), `text-text-overlay`, `text-text-overlay-secondary` |
|
|
68
|
+
|
|
69
|
+
### Borders (`border-border-*` / `var(--color-border-*)`)
|
|
70
|
+
|
|
71
|
+
| Category | Utility Classes |
|
|
72
|
+
|---|---|
|
|
73
|
+
| Neutral Weights | `border-border-divider` (`gray50`), `border-border-thin` (`gray75`), `border-border-regular` (`gray100`), `border-border-bold` (`gray400`) |
|
|
74
|
+
| States & Contrast | `border-border-active` (brand), `border-border-disabled`, `border-border-blank` (white), `border-border-black` |
|
|
75
|
+
| Semantic | `border-border-brand`, `border-border-info`, `border-border-success`, `border-border-error`, `border-border-warning`, `border-border-overlay` |
|
|
76
|
+
|
|
77
|
+
### Icons (`text-icon-*` / `var(--color-icon-*)`)
|
|
78
|
+
|
|
79
|
+
| Category | Utility Classes |
|
|
80
|
+
|---|---|
|
|
81
|
+
| Neutral | `text-icon-primary`, `text-icon-secondary`, `text-icon-tertiary`, `text-icon-disabled`, `text-icon-blank`, `text-icon-on-background` |
|
|
82
|
+
| Brand & Semantic | `text-icon-brand`, `text-icon-chotot`, `text-icon-chotot-bold`, `text-icon-info`, `text-icon-success`, `text-icon-error`, `text-icon-warning` |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 4. Interaction State Tokens
|
|
87
|
+
|
|
88
|
+
Pattern: `{hover|active}:bg-interaction-{palette}-{hover|pressed}` (and `-light-{hover|pressed}`).
|
|
89
|
+
Palettes: `brand`, `info`, `success`, `error`, `neutral`, `warning`.
|
|
90
|
+
|
|
91
|
+
```html
|
|
92
|
+
<div class="bg-background-brand hover:bg-interaction-brand-hover active:bg-interaction-brand-pressed">
|
|
93
|
+
<div class="bg-background-brand-light hover:bg-interaction-brand-light-hover active:bg-interaction-brand-light-pressed">
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 5. Typography Scale & Utilities
|
|
99
|
+
|
|
100
|
+
Always use Clad UI semantic typography classes or React Typography components (`<BodySection>`, `<HeaderPage>`, etc.) instead of arbitrary sizes (`text-sm`, `text-xs`) or manual weights (`font-bold`).
|
|
101
|
+
|
|
102
|
+
| Category | Utility Classes | Weight | Sizes (`page` → `section` → `caption` → `annotation`) |
|
|
103
|
+
|---|---|---|---|
|
|
104
|
+
| Display | `text-display-{page,section,caption,annotation}` | Bold (700) | `2rem` (32px), `1.5rem` (24px), `1.25rem` (20px), `1.125rem` (18px) |
|
|
105
|
+
| Header | `text-header-{page,section,caption,annotation}` | SemiBold (600) | `1.25rem` (20px), `1rem` (16px), `0.875rem` (14px), `0.75rem` (12px) |
|
|
106
|
+
| Label | `text-label-{page,section,caption,annotation}` | Bold (700) | `1rem` (16px), `0.875rem` (14px), `0.75rem` (12px), `0.625rem` (10px) |
|
|
107
|
+
| Body | `text-body-{page,section,caption,annotation}` | Regular (400) | `1rem` (16px), `0.875rem` (14px), `0.75rem` (12px), `0.625rem` (10px) |
|
|
108
|
+
| Note | `text-note-{page,section,caption}` | Italic (400) | `0.875rem` (14px), `0.75rem` (12px), `0.625rem` (10px) |
|
|
109
|
+
| Tagline | `text-tagline-{section,caption,annotation,footext}` | Medium (500) | `1rem` (16px), `0.875rem` (14px), `0.75rem` (12px), `0.625rem` (10px) |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 6. Spacing, Sizing, Radius, Stroke & Shadows
|
|
114
|
+
|
|
115
|
+
| Design Token Group | CSS Variables (`@theme static`) | Tailwind Utilities / Resolved Values |
|
|
116
|
+
|---|---|---|
|
|
117
|
+
| **Radius** | `--radius-ad-small` (`4px`), `--radius-ad` (`6px`), `--radius-card-small` (`8px`), `--radius-card` (`12px`), `--radius-decoration` (`16px`), `--radius-modal` (`20px`), `--radius-pill` (`999px`) | `rounded-ad-small` (`4px`), `rounded-ad` (`6px`), `rounded-card-small` (`8px`), `rounded-card` (`12px`), `rounded-decoration` (`16px`), `rounded-modal` (`20px`), `rounded-pill` (`999px`) |
|
|
118
|
+
| **Stroke** | `--stroke-divider` (`1px`), `--stroke-action` (`2px`), `--stroke-emphasize` (`3px`) | `border` (`1px`), `border-2` (`2px`), `border-[3px]` (`3px`) |
|
|
119
|
+
| **Spacing & Padding** | `--spacing-0` (`0`), `--spacing-min-2` (`2px`), `--spacing-2x-small-4` (`4px`), `--spacing-2x-small-6` (`6px`), `--spacing-x-small-8` (`8px`), `--spacing-small-12` (`12px`), `--spacing-medium-16` (`16px`), `--spacing-large-20` (`20px`) · `--padding-*` (`2..20px`) · `--pad-section-{desktop,mobile}`, `--v-pad-section-{desktop,mobile}` | `p-1` (`4px`), `p-2` (`8px`), `p-3` (`12px`), `p-4` (`16px`), `p-5` (`20px`) (also `m-*`, `gap-*`) |
|
|
120
|
+
| **Shadows / Elevation** | `--shadow-below` (`0px 4px 8px rgba(89,89,89,0.15)`), `--shadow-floating` (`0px 4px 16px rgba(34,34,34,0.12)`) | `shadow-below`, `shadow-floating` |
|
|
121
|
+
| **Control Heights** | `S` (`24px`), `M` (`32px`), `L` (`40px`), `XL` (`48px`) | `h-6` / `h-8` / `h-10` / `h-12` |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 7. Debug Mode
|
|
126
|
+
|
|
127
|
+
Components include `data-clad="<component-name>"`. Enable component boundaries in development via CSS:
|
|
128
|
+
|
|
129
|
+
```css
|
|
130
|
+
:root {
|
|
131
|
+
--cladebug: red;
|
|
132
|
+
--cladebug-label: block;
|
|
133
|
+
}
|
|
134
|
+
```
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clad-ui-feedback
|
|
3
|
+
description: Report bugs, request component/token/icon enhancements, or propose new ideas for @chotot/clad-ui, @chotot/icons, and @chotot/charts by creating structured GitHub issues in carousell/clad-ui. Use when a consumer developer hits a design system bug, missing prop/icon/token, migration blocker, or asks to file feedback/issue for Clad UI.
|
|
4
|
+
metadata:
|
|
5
|
+
purpose: Report bugs, request component/token/icon enhancements, or propose new ideas for @chotot/clad-ui, @chotot/icons, and @chotot/charts by creating structured GitHub issues in carousell/clad-ui. Use when a consumer developer hits a design system bug, missing prop/icon/token, migration blocker, or asks to file feedback/issue for Clad UI.
|
|
6
|
+
type: sub-skill
|
|
7
|
+
library: '@chotot/clad-ui'
|
|
8
|
+
library_version: '3.0.0-next.4'
|
|
9
|
+
requires:
|
|
10
|
+
- clad-ui
|
|
11
|
+
sources:
|
|
12
|
+
- 'carousell/clad-ui:packages/clad-ui/src/**'
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Clad UI Feedback & Issue Reporter (`carousell/clad-ui`)
|
|
16
|
+
|
|
17
|
+
## Role
|
|
18
|
+
|
|
19
|
+
You are a Design System feedback operator for consumer repositories using `@chotot/clad-ui`, `@chotot/icons`, and `@chotot/charts`.
|
|
20
|
+
You turn a developer's bug report, enhancement request, or component/icon idea into a deduplicated, context-rich GitHub issue on `carousell/clad-ui`.
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
### Step 1 — Auto-Collect Consumer Environment
|
|
25
|
+
|
|
26
|
+
Inspect the consumer repository's root `package.json` (and `node_modules/@chotot/*/package.json` if needed) without asking the developer to type versions manually:
|
|
27
|
+
|
|
28
|
+
- **Consumer Repo:** `name` field in `package.json`
|
|
29
|
+
- **Installed Versions:** `@chotot/clad-ui`, `@chotot/icons`, `@chotot/charts`
|
|
30
|
+
- **Target Area:** affected component, semantic token, icon name, or skill (`clad-ui` / `migrate-clad-ui-v3`)
|
|
31
|
+
- **Active Theme (if relevant):** `data-theme="chotot" | "pty" | "job" | "veh"`
|
|
32
|
+
|
|
33
|
+
### Step 2 — Check for Existing Issues (Deduplication)
|
|
34
|
+
|
|
35
|
+
Search open issues in `carousell/clad-ui` before drafting:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
gh issue list --repo carousell/clad-ui --state open --search "<component-or-keyword>" --limit 5
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
*(Fallback when `gh` CLI is unavailable: use MCP tool `github__list_issues` with `owner: "carousell"`, `repo: "clad-ui"`).*
|
|
42
|
+
|
|
43
|
+
- **If a matching open issue already exists:** show the existing issue number, title, and URL to the user. Ask whether they want to add their consumer repo use case as a comment (`gh issue comment <num> --repo carousell/clad-ui --body "..."`) or stop. Do **not** open a duplicate issue.
|
|
44
|
+
|
|
45
|
+
### Step 3 — Classify & Draft Issue
|
|
46
|
+
|
|
47
|
+
Select one of the 3 official `carousell/clad-ui` issue categories and labels:
|
|
48
|
+
|
|
49
|
+
#### 1. 🐛 Bug (`--label "bug"`)
|
|
50
|
+
- **Title format:** `fix(<component-or-package>): <concise summary>`
|
|
51
|
+
- **Body template:**
|
|
52
|
+
```markdown
|
|
53
|
+
## Summary
|
|
54
|
+
<1-2 sentences describing the bug>
|
|
55
|
+
|
|
56
|
+
## Environment
|
|
57
|
+
- **Consumer Repo:** `<repo-name>`
|
|
58
|
+
- **`@chotot/clad-ui`:** `<version>`
|
|
59
|
+
- **`@chotot/icons`:** `<version>`
|
|
60
|
+
- **Theme (`data-theme`):** `<chotot | pty | job | veh>`
|
|
61
|
+
|
|
62
|
+
## Reproduction
|
|
63
|
+
```tsx
|
|
64
|
+
// Minimal TSX / CSS snippet reproducing the issue
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Expected vs Actual Behavior
|
|
68
|
+
- **Expected:** <expected behavior>
|
|
69
|
+
- **Actual:** <actual behavior>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### 2. ✨ Enhancement (`--label "enhancement"`)
|
|
73
|
+
- **Title format:** `feat(<component-or-package>): <concise summary>`
|
|
74
|
+
- **Body template:**
|
|
75
|
+
```markdown
|
|
76
|
+
## Summary
|
|
77
|
+
<1-2 sentences describing the requested enhancement>
|
|
78
|
+
|
|
79
|
+
## Consumer Context & Current Workaround
|
|
80
|
+
- **Consumer Repo:** `<repo-name>` (`@chotot/clad-ui@<version>`)
|
|
81
|
+
- **Use Case:** <why the consumer product needs this prop/token/behavior>
|
|
82
|
+
- **Current Workaround:** <wrapper/hack currently required, if any>
|
|
83
|
+
|
|
84
|
+
## Proposed API / Token Change
|
|
85
|
+
```tsx
|
|
86
|
+
// Proposed prop, variant, token, or behavior
|
|
87
|
+
```
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### 3. 💡 Idea / New Component / New Icon (`--label "feature"`)
|
|
91
|
+
- **Title format:** `feat(<icons-or-component>): <concise summary>`
|
|
92
|
+
- **Body template:**
|
|
93
|
+
```markdown
|
|
94
|
+
## Proposal
|
|
95
|
+
<Description of the new component, pattern, or `@chotot/icons` icon>
|
|
96
|
+
|
|
97
|
+
## Product Use Case
|
|
98
|
+
- **Consumer Repo & Vertical:** `<repo-name>` (`chotot` / `pty` / `job` / `veh`)
|
|
99
|
+
- **Figma / Design Reference:** <link or N/A>
|
|
100
|
+
|
|
101
|
+
## Proposed Usage
|
|
102
|
+
```tsx
|
|
103
|
+
// Example JSX usage
|
|
104
|
+
```
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Step 4 — 1-Step Confirmation Gate & Submit
|
|
108
|
+
|
|
109
|
+
1. **Always preview** the drafted `Title`, `Label`, and `Body` to the user and ask for confirmation before creating the issue.
|
|
110
|
+
2. **Once confirmed**, submit using the first available channel:
|
|
111
|
+
- **Priority 1 — GitHub CLI (`gh`):**
|
|
112
|
+
```bash
|
|
113
|
+
body_file=$(mktemp /tmp/clad-ui-issue.XXXXXX)
|
|
114
|
+
# write body to $body_file, then:
|
|
115
|
+
gh issue create --repo carousell/clad-ui --title "<title>" --label "<bug|enhancement|feature>" --body-file "$body_file"
|
|
116
|
+
rm -f "$body_file"
|
|
117
|
+
```
|
|
118
|
+
- **Priority 2 — MCP Tool (`builder-os-gateway`):**
|
|
119
|
+
Call `github__create_issue` with `owner: "carousell"`, `repo: "clad-ui"`, `title`, `body`, and `labels: ["<bug|enhancement|feature>"]`.
|
|
120
|
+
- **Priority 3 — Pre-filled Browser URL Fallback** (when neither `gh` nor MCP is authenticated):
|
|
121
|
+
Output a clickable Markdown link:
|
|
122
|
+
`https://github.com/carousell/clad-ui/issues/new?labels=<label>&title=<url-encoded-title>&body=<url-encoded-body>`
|
|
123
|
+
|
|
124
|
+
## Guardrails
|
|
125
|
+
|
|
126
|
+
- Never create a GitHub issue without explicit user confirmation of the drafted preview.
|
|
127
|
+
- Never include private tokens, credentials, or internal customer PII in issue bodies.
|
|
128
|
+
- Always check for open duplicates on `carousell/clad-ui` before creating a new issue.
|