@chotot/clad-ui 0.16.1
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/LICENSE +201 -0
- package/README.md +75 -0
- package/brand/ChototLogoText.d.ts +5 -0
- package/brand/CtC2C.d.ts +5 -0
- package/brand/CtProperty.d.ts +5 -0
- package/brand/CtVehicle.d.ts +5 -0
- package/brand/Tot.d.ts +5 -0
- package/brand/index.d.ts +5 -0
- package/components/Announcer/Announcer.d.ts +30 -0
- package/components/Announcer/Announcer.js +163 -0
- package/components/Announcer/Announcer.stories.js +388 -0
- package/components/Announcer/Announcer.styles.d.ts +20 -0
- package/components/Announcer/Announcer.styles.js +214 -0
- package/components/Box/Box.d.ts +79 -0
- package/components/Box/Box.js +314 -0
- package/components/Box/Box.spec.js +425 -0
- package/components/Box/Box.stories.js +491 -0
- package/components/Box/Box.styles.d.ts +5 -0
- package/components/Box/Box.styles.js +71 -0
- package/components/Breadcrumbs/Breadcrumbs.d.ts +20 -0
- package/components/Breadcrumbs/Breadcrumbs.js +92 -0
- package/components/Breadcrumbs/Breadcrumbs.stories.js +170 -0
- package/components/Breadcrumbs/Breadcrumbs.styles.d.ts +6 -0
- package/components/Breadcrumbs/Breadcrumbs.styles.js +44 -0
- package/components/Button/Button.d.ts +34 -0
- package/components/Button/Button.js +165 -0
- package/components/Button/Button.stories.js +370 -0
- package/components/Button/Button.styles.d.ts +2 -0
- package/components/Button/Button.styles.js +327 -0
- package/components/Button/ButtonLink.d.ts +29 -0
- package/components/Button/ButtonLink.js +89 -0
- package/components/Button/ButtonLink.stories.js +31 -0
- package/components/Button/IconButton.d.ts +28 -0
- package/components/Button/IconButton.js +81 -0
- package/components/Button/IconButton.stories.js +62 -0
- package/components/Checkbox/Checkbox.d.ts +30 -0
- package/components/Checkbox/Checkbox.js +106 -0
- package/components/Checkbox/Checkbox.stories.js +194 -0
- package/components/Checkbox/Checkbox.styles.d.ts +4 -0
- package/components/Checkbox/Checkbox.styles.js +112 -0
- package/components/Chip/Chip.d.ts +26 -0
- package/components/Chip/Chip.js +84 -0
- package/components/Chip/Chip.stories.js +130 -0
- package/components/Chip/Chip.styles.d.ts +5 -0
- package/components/Chip/Chip.styles.js +41 -0
- package/components/CurrencyInput/CurrencyInput.d.ts +53 -0
- package/components/CurrencyInput/CurrencyInput.js +369 -0
- package/components/CurrencyInput/CurrencyInput.spec.js +151 -0
- package/components/CurrencyInput/CurrencyInput.stories.js +202 -0
- package/components/CurrencyInput/CurrencyInput.styles.d.ts +18 -0
- package/components/CurrencyInput/CurrencyInput.styles.js +169 -0
- package/components/CurrencyInput/utils/_cleanValue.d.ts +11 -0
- package/components/CurrencyInput/utils/_cleanValue.js +55 -0
- package/components/CurrencyInput/utils/_cleanValue.spec.js +20 -0
- package/components/CurrencyInput/utils/_formatValue.d.ts +5 -0
- package/components/CurrencyInput/utils/_formatValue.js +99 -0
- package/components/CurrencyInput/utils/_formatValue.spec.js +32 -0
- package/components/Dropdown/Dropdown.d.ts +47 -0
- package/components/Dropdown/Dropdown.js +214 -0
- package/components/Dropdown/Dropdown.stories.js +323 -0
- package/components/Grid/Col.d.ts +30 -0
- package/components/Grid/Col.js +93 -0
- package/components/Grid/Col.spec.js +249 -0
- package/components/Grid/Grid.d.ts +36 -0
- package/components/Grid/Grid.js +180 -0
- package/components/Grid/Grid.spec.js +524 -0
- package/components/Grid/Grid.styles.d.ts +12 -0
- package/components/Grid/Grid.styles.js +228 -0
- package/components/Grid/aGrid.stories.js +577 -0
- package/components/Grid/bCol.stories.js +217 -0
- package/components/Input/Input.d.ts +50 -0
- package/components/Input/Input.js +342 -0
- package/components/Input/Input.spec.js +177 -0
- package/components/Input/Input.stories.js +424 -0
- package/components/Input/Input.styles.d.ts +20 -0
- package/components/Input/Input.styles.js +236 -0
- package/components/RadioButton/RadioButton.d.ts +30 -0
- package/components/RadioButton/RadioButton.js +107 -0
- package/components/RadioButton/RadioButton.stories.js +208 -0
- package/components/ShapeIcon/ShapeIcon.d.ts +36 -0
- package/components/ShapeIcon/ShapeIcon.js +74 -0
- package/components/ShapeIcon/ShapeIcon.stories.js +94 -0
- package/components/Snack/Snack.d.ts +20 -0
- package/components/Snack/Snack.js +82 -0
- package/components/Snack/Snack.spec.js +24 -0
- package/components/Snack/Snack.stories.js +235 -0
- package/components/Snack/Snack.styles.d.ts +6 -0
- package/components/Snack/Snack.styles.js +69 -0
- package/components/Tabs/Tab.d.ts +34 -0
- package/components/Tabs/Tab.js +145 -0
- package/components/Tabs/Tabs.d.ts +24 -0
- package/components/Tabs/Tabs.js +107 -0
- package/components/Tabs/Tabs.spec.js +57 -0
- package/components/Tabs/Tabs.stories.js +165 -0
- package/components/Tabs/Tabs.styles.d.ts +18 -0
- package/components/Tabs/Tabs.styles.js +86 -0
- package/components/TextArea/TextArea.d.ts +48 -0
- package/components/TextArea/TextArea.js +211 -0
- package/components/TextArea/TextArea.stories.js +411 -0
- package/components/TextArea/TextArea.styles.d.ts +16 -0
- package/components/TextArea/TextArea.styles.js +150 -0
- package/components/Tooltip/Tooltip.d.ts +34 -0
- package/components/Tooltip/Tooltip.js +188 -0
- package/components/Tooltip/Tooltip.spec.js +26 -0
- package/components/Tooltip/Tooltip.stories.js +467 -0
- package/components/Tooltip/Tooltip.styles.d.ts +5 -0
- package/components/Tooltip/Tooltip.styles.js +57 -0
- package/components/components-index.spec.js +29 -0
- package/components/index.d.ts +20 -0
- package/components/index.js +20 -0
- package/css/__snapshots__/baseline.spec.js.snap +3 -0
- package/css/baseline.d.ts +14 -0
- package/css/baseline.js +420 -0
- package/css/baseline.spec.js +32 -0
- package/declarations.d.ts +1 -0
- package/docs/1.1-intro.stories.mdx +18 -0
- package/docs/1.2-getting-started.stories.mdx +111 -0
- package/docs/1.3-theming.stories.mdx +193 -0
- package/docs/1.4-development-guide.stories.mdx +448 -0
- package/docs/1.5-contribution-guide.stories.mdx +19 -0
- package/docs/1.6-solution-rationale.stories.mdx +155 -0
- package/docs/1.7-team-members.stories.mdx +138 -0
- package/docs/2.1-tokens-intro.stories.mdx +51 -0
- package/docs/2.2-colors.stories.mdx +124 -0
- package/docs/2.2-typography.stories.mdx +126 -0
- package/docs/2.4-others.stories.mdx +180 -0
- package/docs/2.5-icons.stories.mdx +64 -0
- package/docs/2.6-baselinecss.stories.mdx +439 -0
- package/docs/2.7-layout-breakpoints.stories.mdx +185 -0
- package/icons/ArrowDown.d.ts +5 -0
- package/icons/ArrowDown.js +21 -0
- package/icons/ArrowDownB.d.ts +5 -0
- package/icons/ArrowDownB.js +21 -0
- package/icons/ArrowLeft.d.ts +5 -0
- package/icons/ArrowLeft.js +24 -0
- package/icons/ArrowRight.d.ts +5 -0
- package/icons/ArrowRight.js +24 -0
- package/icons/Back.d.ts +5 -0
- package/icons/Back.js +21 -0
- package/icons/Bell.d.ts +5 -0
- package/icons/Bell.js +21 -0
- package/icons/BellOutline.d.ts +5 -0
- package/icons/BellOutline.js +21 -0
- package/icons/BinOutline.d.ts +5 -0
- package/icons/BinOutline.js +25 -0
- package/icons/Bookmark.d.ts +5 -0
- package/icons/Bookmark.js +21 -0
- package/icons/BookmarkOutline.d.ts +5 -0
- package/icons/BookmarkOutline.js +21 -0
- package/icons/BoyFace.d.ts +5 -0
- package/icons/BoyFace.js +25 -0
- package/icons/BoyFaceOutline.d.ts +5 -0
- package/icons/BoyFaceOutline.js +21 -0
- package/icons/Bump.d.ts +5 -0
- package/icons/Bump.js +33 -0
- package/icons/BumpTime.d.ts +5 -0
- package/icons/BumpTime.js +35 -0
- package/icons/CallOutline.d.ts +5 -0
- package/icons/CallOutline.js +24 -0
- package/icons/Camera.d.ts +5 -0
- package/icons/Camera.js +31 -0
- package/icons/CardPayment.d.ts +5 -0
- package/icons/CardPayment.js +21 -0
- package/icons/Certificate.d.ts +5 -0
- package/icons/Certificate.js +25 -0
- package/icons/Chart.d.ts +5 -0
- package/icons/Chart.js +27 -0
- package/icons/ChartImpression.d.ts +5 -0
- package/icons/ChartImpression.js +28 -0
- package/icons/ChartView.d.ts +5 -0
- package/icons/ChartView.js +27 -0
- package/icons/Chat.d.ts +5 -0
- package/icons/Chat.js +29 -0
- package/icons/Check.d.ts +5 -0
- package/icons/Check.js +18 -0
- package/icons/CircleCheck.d.ts +5 -0
- package/icons/CircleCheck.js +27 -0
- package/icons/CircleCopylink.d.ts +5 -0
- package/icons/CircleCopylink.js +23 -0
- package/icons/CircleFacebook.d.ts +5 -0
- package/icons/CircleFacebook.js +22 -0
- package/icons/CircleMessenger.d.ts +5 -0
- package/icons/CircleMessenger.js +19 -0
- package/icons/CircleSms.d.ts +5 -0
- package/icons/CircleSms.js +22 -0
- package/icons/CircleUser.d.ts +5 -0
- package/icons/CircleUser.js +24 -0
- package/icons/CircleViber.d.ts +5 -0
- package/icons/CircleViber.js +28 -0
- package/icons/CircleZalo.d.ts +5 -0
- package/icons/CircleZalo.js +63 -0
- package/icons/Clock.d.ts +5 -0
- package/icons/Clock.js +21 -0
- package/icons/Close.d.ts +5 -0
- package/icons/Close.js +21 -0
- package/icons/CtCoin.d.ts +5 -0
- package/icons/CtCoin.js +218 -0
- package/icons/Download.d.ts +5 -0
- package/icons/Download.js +25 -0
- package/icons/Edit.d.ts +5 -0
- package/icons/Edit.js +23 -0
- package/icons/EditAd.d.ts +5 -0
- package/icons/EditAd.js +22 -0
- package/icons/Ellipsis.d.ts +5 -0
- package/icons/Ellipsis.js +21 -0
- package/icons/EllipsisOutline.d.ts +5 -0
- package/icons/EllipsisOutline.js +21 -0
- package/icons/FacebookOutline.d.ts +5 -0
- package/icons/FacebookOutline.js +32 -0
- package/icons/Follow.d.ts +5 -0
- package/icons/Follow.js +38 -0
- package/icons/Gallery.d.ts +5 -0
- package/icons/Gallery.js +24 -0
- package/icons/Gift.d.ts +5 -0
- package/icons/Gift.js +24 -0
- package/icons/GiftOutline.d.ts +5 -0
- package/icons/GiftOutline.js +21 -0
- package/icons/Heart.d.ts +5 -0
- package/icons/Heart.js +23 -0
- package/icons/HeartOutline.d.ts +5 -0
- package/icons/HeartOutline.js +23 -0
- package/icons/HideAd.d.ts +5 -0
- package/icons/HideAd.js +22 -0
- package/icons/Hot.d.ts +5 -0
- package/icons/Hot.js +21 -0
- package/icons/House.d.ts +5 -0
- package/icons/House.js +21 -0
- package/icons/HouseOutline.d.ts +5 -0
- package/icons/HouseOutline.js +21 -0
- package/icons/Impression.d.ts +5 -0
- package/icons/Impression.js +56 -0
- package/icons/Info.d.ts +5 -0
- package/icons/Info.js +21 -0
- package/icons/InsertAd.d.ts +5 -0
- package/icons/InsertAd.js +21 -0
- package/icons/InternationalPayment.d.ts +5 -0
- package/icons/InternationalPayment.js +43 -0
- package/icons/Label.d.ts +5 -0
- package/icons/Label.js +24 -0
- package/icons/Loan.d.ts +5 -0
- package/icons/Loan.js +48 -0
- package/icons/Location.d.ts +5 -0
- package/icons/Location.js +25 -0
- package/icons/LocationOutline.d.ts +5 -0
- package/icons/LocationOutline.js +27 -0
- package/icons/MailOutline.d.ts +5 -0
- package/icons/MailOutline.js +32 -0
- package/icons/Medal.d.ts +5 -0
- package/icons/Medal.js +21 -0
- package/icons/Msg.d.ts +5 -0
- package/icons/Msg.js +42 -0
- package/icons/PageIndicator.d.ts +5 -0
- package/icons/PageIndicator.js +25 -0
- package/icons/PaymentInfo.d.ts +5 -0
- package/icons/PaymentInfo.js +42 -0
- package/icons/PercentMsg.d.ts +5 -0
- package/icons/PercentMsg.js +51 -0
- package/icons/PhoneOutline.d.ts +5 -0
- package/icons/PhoneOutline.js +21 -0
- package/icons/Profile.d.ts +5 -0
- package/icons/Profile.js +29 -0
- package/icons/Search.d.ts +5 -0
- package/icons/Search.js +21 -0
- package/icons/Selected.d.ts +5 -0
- package/icons/Selected.js +34 -0
- package/icons/SellFaster.d.ts +5 -0
- package/icons/SellFaster.js +32 -0
- package/icons/Shop.d.ts +5 -0
- package/icons/Shop.js +22 -0
- package/icons/ShopFree.d.ts +5 -0
- package/icons/ShopFree.js +49 -0
- package/icons/ShopOutline.d.ts +5 -0
- package/icons/ShopOutline.js +24 -0
- package/icons/SpeechBubbles.d.ts +5 -0
- package/icons/SpeechBubbles.js +25 -0
- package/icons/SpeechBubblesOutline.d.ts +5 -0
- package/icons/SpeechBubblesOutline.js +21 -0
- package/icons/Star.d.ts +5 -0
- package/icons/Star.js +22 -0
- package/icons/StarOutline.d.ts +5 -0
- package/icons/StarOutline.js +23 -0
- package/icons/Stats.d.ts +5 -0
- package/icons/Stats.js +25 -0
- package/icons/Sticky.d.ts +5 -0
- package/icons/Sticky.js +29 -0
- package/icons/Suitcase.d.ts +5 -0
- package/icons/Suitcase.js +25 -0
- package/icons/Tot.d.ts +5 -0
- package/icons/Tot.js +21 -0
- package/icons/UnhideOutline.d.ts +5 -0
- package/icons/UnhideOutline.js +25 -0
- package/icons/User.d.ts +5 -0
- package/icons/User.js +138 -0
- package/icons/UserOutline.d.ts +5 -0
- package/icons/UserOutline.js +22 -0
- package/icons/Users.d.ts +5 -0
- package/icons/Users.js +44 -0
- package/icons/Verification.d.ts +5 -0
- package/icons/Verification.js +22 -0
- package/icons/VerifiedHouse.d.ts +5 -0
- package/icons/VerifiedHouse.js +30 -0
- package/icons/ViewMore.d.ts +5 -0
- package/icons/ViewMore.js +25 -0
- package/icons/Wallet.d.ts +5 -0
- package/icons/Wallet.js +35 -0
- package/icons/Warning.d.ts +5 -0
- package/icons/Warning.js +33 -0
- package/icons/index.d.ts +88 -0
- package/icons/index.js +88 -0
- package/index.d.ts +25 -0
- package/index.js +25 -0
- package/index.spec.js +50 -0
- package/package.json +178 -0
- package/patterns/Dialog/Dialog.d.ts +32 -0
- package/patterns/Dialog/Dialog.js +130 -0
- package/patterns/Dialog/Dialog.stories.js +388 -0
- package/patterns/Dialog/Dialog.styles.d.ts +14 -0
- package/patterns/Dialog/Dialog.styles.js +194 -0
- package/patterns/InputGroup/InputGroup.d.ts +18 -0
- package/patterns/InputGroup/InputGroup.js +52 -0
- package/patterns/InputGroup/InputGroup.spec.js +58 -0
- package/patterns/InputGroup/InputGroup.stories.js +203 -0
- package/patterns/InputGroup/InputGroup.styles.d.ts +6 -0
- package/patterns/InputGroup/InputGroup.styles.js +83 -0
- package/patterns/Popup/Popup.d.ts +41 -0
- package/patterns/Popup/Popup.js +175 -0
- package/patterns/Popup/Popup.spec.js +74 -0
- package/patterns/Popup/Popup.stories.js +548 -0
- package/patterns/Popup/Popup.styles.d.ts +20 -0
- package/patterns/Popup/Popup.styles.js +230 -0
- package/patterns/SearchInput/SearchInput.d.ts +66 -0
- package/patterns/SearchInput/SearchInput.js +355 -0
- package/patterns/SearchInput/SearchInput.stories.js +505 -0
- package/patterns/SearchInput/SearchInput.styles.d.ts +2 -0
- package/patterns/SearchInput/SearchInput.styles.js +49 -0
- package/patterns/TagCloud/TagCloud.d.ts +37 -0
- package/patterns/TagCloud/TagCloud.js +120 -0
- package/patterns/TagCloud/TagCloud.spec.js +163 -0
- package/patterns/TagCloud/TagCloud.stories.js +364 -0
- package/patterns/TagCloud/TagCloud.styles.d.ts +10 -0
- package/patterns/TagCloud/TagCloud.styles.js +39 -0
- package/patterns/TagCloud/TagCloudMultiActive.d.ts +42 -0
- package/patterns/TagCloud/TagCloudMultiActive.js +116 -0
- package/patterns/TagCloud/TagCloudSingleActive.d.ts +29 -0
- package/patterns/TagCloud/TagCloudSingleActive.js +64 -0
- package/patterns/index.d.ts +5 -0
- package/patterns/index.js +5 -0
- package/patterns/patterns-index.spec.js +25 -0
- package/scripts/create-badge-svg.d.ts +2 -0
- package/scripts/template-icons-index.d.ts +2 -0
- package/scripts/template-svg-icon.d.ts +16 -0
- package/shared/global.d.ts +12 -0
- package/shared/global.js +17 -0
- package/storybook/components/Bar.d.ts +10 -0
- package/storybook/components/BorderRadius.d.ts +12 -0
- package/storybook/components/BorderWidth.d.ts +10 -0
- package/storybook/components/Gradient.d.ts +16 -0
- package/storybook/components/GuideImage.d.ts +22 -0
- package/storybook/components/Icons.d.ts +2 -0
- package/storybook/components/Member.d.ts +26 -0
- package/storybook/components/Shadow.d.ts +10 -0
- package/storybook/components/Square.d.ts +10 -0
- package/storybook/components/Swatch.d.ts +10 -0
- package/storybook/components/Transition.d.ts +10 -0
- package/storybook/components/Type.d.ts +42 -0
- package/storybook/main.d.ts +3 -0
- package/storybook/manager.d.ts +1 -0
- package/storybook/preview.d.ts +76 -0
- package/storybook/theme-clad.d.ts +2 -0
- package/storybook/utils/jsonStringify.d.ts +8 -0
- package/storybook/utils/loadFontsForStorybook.d.ts +1 -0
- package/theme/__snapshots__/chotot.spec.js.snap +262 -0
- package/theme/__snapshots__/mudah.spec.js.snap +161 -0
- package/theme/chotot.d.ts +555 -0
- package/theme/chotot.js +937 -0
- package/theme/chotot.spec.js +72 -0
- package/theme/index.d.ts +2 -0
- package/theme/index.js +7 -0
- package/theme/mudah.d.ts +214 -0
- package/theme/mudah.js +333 -0
- package/theme/mudah.spec.js +9 -0
- package/types.d.ts +14 -0
- package/utils/_normalizeArrowKey.d.ts +9 -0
- package/utils/_normalizeArrowKey.js +17 -0
- package/utils/_simulateChangeEvent.d.ts +9 -0
- package/utils/_simulateChangeEvent.js +34 -0
- package/utils/_simulateChangeEvent.spec.js +54 -0
- package/utils/cleanHtml.d.ts +8 -0
- package/utils/cleanHtml.js +14 -0
- package/utils/cleanHtml.spec.js +45 -0
- package/utils/createUniversalPortal.d.ts +10 -0
- package/utils/createUniversalPortal.js +22 -0
- package/utils/createUniversalPortal.server.spec.js +13 -0
- package/utils/createUniversalPortal.spec.js +13 -0
- package/utils/getBreakpointsValues.d.ts +10 -0
- package/utils/getBreakpointsValues.js +24 -0
- package/utils/getBreakpointsValues.test.js +89 -0
- package/utils/index.d.ts +5 -0
- package/utils/index.js +5 -0
- package/utils/noop.d.ts +8 -0
- package/utils/noop.js +9 -0
- package/utils/noop.spec.js +12 -0
- package/utils/sx.d.ts +3770 -0
- package/utils/sx.js +95 -0
- package/utils/sx.spec.js +53 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { default as Announcer } from "./components/Announcer/Announcer";
|
|
2
|
+
export { default as Box } from "./components/Box/Box";
|
|
3
|
+
export { default as Breadcrumbs } from "./components/Breadcrumbs/Breadcrumbs";
|
|
4
|
+
export { default as Button } from "./components/Button/Button";
|
|
5
|
+
export { default as ButtonLink } from "./components/Button/ButtonLink";
|
|
6
|
+
export { default as Checkbox } from "./components/Checkbox/Checkbox";
|
|
7
|
+
export { default as Chip } from "./components/Chip/Chip";
|
|
8
|
+
export { default as Col } from "./components/Grid/Col";
|
|
9
|
+
export { default as Dialog } from "./patterns/Dialog/Dialog";
|
|
10
|
+
export { default as Dropdown } from "./components/Dropdown/Dropdown";
|
|
11
|
+
export { default as Grid } from "./components/Grid/Grid";
|
|
12
|
+
export { default as IconButton } from "./components/Button/IconButton";
|
|
13
|
+
export { default as Input } from "./components/Input/Input";
|
|
14
|
+
export { default as Popup } from "./patterns/Popup/Popup";
|
|
15
|
+
export { default as RadioButton } from "./components/RadioButton/RadioButton";
|
|
16
|
+
export { default as ShapeIcon } from "./components/ShapeIcon/ShapeIcon";
|
|
17
|
+
export { default as Snack } from "./components/Snack/Snack";
|
|
18
|
+
export { default as TagCloud } from "./patterns/TagCloud/TagCloud";
|
|
19
|
+
export { default as TextArea } from "./components/TextArea/TextArea";
|
|
20
|
+
export { default as Tooltip } from "./components/Tooltip/Tooltip";
|
|
21
|
+
export { default as CurrencyInput } from "./components/CurrencyInput/CurrencyInput";
|
|
22
|
+
export { default as SearchInput } from "./patterns/SearchInput/SearchInput";
|
|
23
|
+
export { default as Tabs } from "./components/Tabs/Tabs";
|
|
24
|
+
export { default as Tab } from "./components/Tabs/Tab";
|
|
25
|
+
export { default as InputGroup } from "./patterns/InputGroup/InputGroup";
|
package/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { default as Announcer } from './components/Announcer/Announcer';
|
|
2
|
+
export { default as Box } from './components/Box/Box';
|
|
3
|
+
export { default as Breadcrumbs } from './components/Breadcrumbs/Breadcrumbs';
|
|
4
|
+
export { default as Button } from './components/Button/Button';
|
|
5
|
+
export { default as ButtonLink } from './components/Button/ButtonLink';
|
|
6
|
+
export { default as Checkbox } from './components/Checkbox/Checkbox';
|
|
7
|
+
export { default as Chip } from './components/Chip/Chip';
|
|
8
|
+
export { default as Col } from './components/Grid/Col';
|
|
9
|
+
export { default as Dialog } from './patterns/Dialog/Dialog';
|
|
10
|
+
export { default as Dropdown } from './components/Dropdown/Dropdown';
|
|
11
|
+
export { default as Grid } from './components/Grid/Grid';
|
|
12
|
+
export { default as IconButton } from './components/Button/IconButton';
|
|
13
|
+
export { default as Input } from './components/Input/Input';
|
|
14
|
+
export { default as Popup } from './patterns/Popup/Popup';
|
|
15
|
+
export { default as RadioButton } from './components/RadioButton/RadioButton';
|
|
16
|
+
export { default as ShapeIcon } from './components/ShapeIcon/ShapeIcon';
|
|
17
|
+
export { default as Snack } from './components/Snack/Snack';
|
|
18
|
+
export { default as TagCloud } from './patterns/TagCloud/TagCloud';
|
|
19
|
+
export { default as TextArea } from './components/TextArea/TextArea';
|
|
20
|
+
export { default as Tooltip } from './components/Tooltip/Tooltip';
|
|
21
|
+
export { default as CurrencyInput } from './components/CurrencyInput/CurrencyInput';
|
|
22
|
+
export { default as SearchInput } from './patterns/SearchInput/SearchInput';
|
|
23
|
+
export { default as Tabs } from './components/Tabs/Tabs';
|
|
24
|
+
export { default as Tab } from './components/Tabs/Tab';
|
|
25
|
+
export { default as InputGroup } from './patterns/InputGroup/InputGroup';
|
package/index.spec.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import glob from 'glob';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import * as components from './index';
|
|
4
|
+
|
|
5
|
+
// add module name here to get ignored
|
|
6
|
+
const ignoredModules = ['index', 'TagCloudSingleActive', 'TagCloudMultiActive'];
|
|
7
|
+
|
|
8
|
+
describe('clad-ui/index', () => {
|
|
9
|
+
it('should export all Components inside components folder', (done) => {
|
|
10
|
+
glob(
|
|
11
|
+
path.resolve(__dirname, 'components/**/!(*.spec|*.test|*.stories|*.styles|_*).js'),
|
|
12
|
+
{},
|
|
13
|
+
(err, files) => {
|
|
14
|
+
const moduleNames = files
|
|
15
|
+
.map((filePath) => path.basename(filePath, '.js'))
|
|
16
|
+
.filter((fileName) => !ignoredModules.includes(fileName));
|
|
17
|
+
|
|
18
|
+
moduleNames.forEach((moduleName) => {
|
|
19
|
+
expect({ module: moduleName, export: components[moduleName] }).toEqual({
|
|
20
|
+
module: moduleName,
|
|
21
|
+
export: expect.anything(),
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
done();
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should export all Components inside patterns folder', (done) => {
|
|
31
|
+
glob(
|
|
32
|
+
path.resolve(__dirname, 'patterns/**/!(*.spec|*.test|*.stories|*.styles).js'),
|
|
33
|
+
{},
|
|
34
|
+
(err, files) => {
|
|
35
|
+
const moduleNames = files
|
|
36
|
+
.map((filePath) => path.basename(filePath, '.js'))
|
|
37
|
+
.filter((fileName) => !ignoredModules.includes(fileName));
|
|
38
|
+
|
|
39
|
+
moduleNames.forEach((moduleName) => {
|
|
40
|
+
expect({ module: moduleName, export: components[moduleName] }).toEqual({
|
|
41
|
+
module: moduleName,
|
|
42
|
+
export: expect.anything(),
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
done();
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chotot/clad-ui",
|
|
3
|
+
"version": "0.16.1",
|
|
4
|
+
"description": "Classified Ads group (Carousell, Chotot, Mudah, Onekyat) design system",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/carousell/clad-ui.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"author": "Chotot Engineers <dev@chotot.vn> (https://github.com/chototoss)",
|
|
11
|
+
"contributors": [
|
|
12
|
+
"Thanh Tran <thanhtran@chotot.vn>",
|
|
13
|
+
"Tân Phạm <tanpham@chotot.vn>",
|
|
14
|
+
"toanle@chotot.vn <toanle@chotot.vn>",
|
|
15
|
+
"huy nguyen <quochuy@chotot.vn>",
|
|
16
|
+
"khoado <khoado@chotot.vn>",
|
|
17
|
+
"An Le <anle@chotot.vn>",
|
|
18
|
+
"Binh Nguyen <binhnguyen@chotot.vn>",
|
|
19
|
+
"tunguyen <tunguyen@chotot.vn>",
|
|
20
|
+
"Minh Luu <minhluu@chotot.vn>",
|
|
21
|
+
"Phu Nguyen <phunguyen@chotot.vn>"
|
|
22
|
+
],
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"./shared/global.js",
|
|
25
|
+
"./css/*.js"
|
|
26
|
+
],
|
|
27
|
+
"main": "./index.js",
|
|
28
|
+
"types": "./index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"**/*.ts",
|
|
31
|
+
"components/**/*.js",
|
|
32
|
+
"patterns/**/*.js",
|
|
33
|
+
"css/",
|
|
34
|
+
"docs/",
|
|
35
|
+
"icons/",
|
|
36
|
+
"shared/",
|
|
37
|
+
"theme/",
|
|
38
|
+
"utils/",
|
|
39
|
+
"index.js",
|
|
40
|
+
"index.spec.js"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"__release": "dotenv yarn build && npx ts-node ./scripts/update-chromatic-url.ts && npx sort-package-json && ./scripts/release.sh",
|
|
44
|
+
"badgen": "node scripts/create-badge-svg.js",
|
|
45
|
+
"prebuild": "yarn type-check && yarn test",
|
|
46
|
+
"build": "yarn typedef",
|
|
47
|
+
"build:brand": "npx @svgr/cli --template scripts/template-svg-icon.js --index-template scripts/template-icons-index.js --svg-props fill=none --replace-attr-values '#222=currentColor' -d brand/ assets/brand/",
|
|
48
|
+
"build:icons": "npx @svgr/cli --template scripts/template-svg-icon.js --index-template scripts/template-icons-index.js --icon --svg-props fill=none --replace-attr-values '#222=currentColor' -d icons/ assets/icons/",
|
|
49
|
+
"prebuild:storybook": "yarn run badgen",
|
|
50
|
+
"build:storybook": "build-storybook -c storybook -o public",
|
|
51
|
+
"postbuild:storybook": "cp -r static/. public/",
|
|
52
|
+
"bump": "echo 'only generate changelog from minor and up' && standard-version -t '' -r minor",
|
|
53
|
+
"postbump": "yarn badgen && git add -u && git commit -q --amend --no-edit",
|
|
54
|
+
"jest": "jest",
|
|
55
|
+
"jest:update-snapshot": "jest -u",
|
|
56
|
+
"jest:watch": "jest --watch",
|
|
57
|
+
"jest:coverage": "jest --ci --coverage",
|
|
58
|
+
"lint-staged:js": "cross-env NODE_ENV=production eslint --cache --cache-location=.cache/eslint --ext .js,.jsx,.html,.ts,.tsx,.mjs --report-unused-disable-directives",
|
|
59
|
+
"lint-staged:package": "sort-package-json",
|
|
60
|
+
"lint:css": "stylelint '**/*.js'",
|
|
61
|
+
"lint:js": "eslint . --report-unused-disable-directives",
|
|
62
|
+
"lint:js-report": "eslint . --report-unused-disable-directives -f json > ./eslint-report.json",
|
|
63
|
+
"prepublishOnly": "yarn build",
|
|
64
|
+
"prestart": "yarn run env | grep '_linaria\":'",
|
|
65
|
+
"start": "start-storybook -c storybook -p 8000 -s static",
|
|
66
|
+
"test": "run-p lint:css lint:js jest",
|
|
67
|
+
"test-coverage": "run-p lint:css lint:js-report jest:coverage",
|
|
68
|
+
"type-check": "tsc --noEmit --project jsconfig.json",
|
|
69
|
+
"pretypedef": "rimraf 'index.d.ts' '{components,patterns,brand,docs,icons,scripts,shared,storybook,theme,utils,css}/**/*.d.ts'",
|
|
70
|
+
"typedef": "tsc --project jsconfig.json --noEmit false --emitDeclarationOnly --declaration",
|
|
71
|
+
"who": "npx git-authors-cli || true"
|
|
72
|
+
},
|
|
73
|
+
"husky": {
|
|
74
|
+
"hooks": {
|
|
75
|
+
"pre-commit": "yarn lint-staged"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"lint-staged": {
|
|
79
|
+
"*.js": [
|
|
80
|
+
"yarn lint-staged:js"
|
|
81
|
+
],
|
|
82
|
+
"package.json": [
|
|
83
|
+
"yarn who",
|
|
84
|
+
"yarn lint-staged:package"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"dependencies": {
|
|
88
|
+
"@styled-system/css": "^5.1.5",
|
|
89
|
+
"@types/styled-system__css": "^5.0.14"
|
|
90
|
+
},
|
|
91
|
+
"devDependencies": {
|
|
92
|
+
"@babel/cli": "^7.13.0",
|
|
93
|
+
"@babel/core": "^7.11.5",
|
|
94
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.13.0",
|
|
95
|
+
"@babel/plugin-transform-runtime": "^7.13.7",
|
|
96
|
+
"@babel/preset-env": "^7.13.5",
|
|
97
|
+
"@babel/preset-react": "^7.12.13",
|
|
98
|
+
"@storybook/addon-a11y": "^6.2.2",
|
|
99
|
+
"@storybook/addon-actions": "^6.2.2",
|
|
100
|
+
"@storybook/addon-docs": "^6.2.2",
|
|
101
|
+
"@storybook/addon-essentials": "^6.2.2",
|
|
102
|
+
"@storybook/addon-storyshots": "^6.2.2",
|
|
103
|
+
"@storybook/addon-storysource": "^6.2.2",
|
|
104
|
+
"@storybook/addons": "^6.2.2",
|
|
105
|
+
"@storybook/react": "^6.2.2",
|
|
106
|
+
"@storybook/source-loader": "^6.2.2",
|
|
107
|
+
"@storybook/theming": "^6.2.2",
|
|
108
|
+
"@testing-library/jest-dom": "^5.12.0",
|
|
109
|
+
"@testing-library/react": "^10.4.8",
|
|
110
|
+
"@types/jest": "^26.0.20",
|
|
111
|
+
"@types/lodash": "^4.14.168",
|
|
112
|
+
"@types/node": "^14.14.31",
|
|
113
|
+
"@types/node-fetch": "^2.5.8",
|
|
114
|
+
"@types/prop-types": "^15.7.2",
|
|
115
|
+
"@types/react": "16.9.46",
|
|
116
|
+
"@types/react-dom": "16.9.8",
|
|
117
|
+
"@types/react-is": "16.7.1",
|
|
118
|
+
"babel-eslint": "^10.0.3",
|
|
119
|
+
"babel-loader": "^8.2.2",
|
|
120
|
+
"babel-plugin-module-resolver": "4.1.0",
|
|
121
|
+
"badgen": "^3.2.2",
|
|
122
|
+
"chromatic": "^5.10.0-canary.0",
|
|
123
|
+
"cross-env": "^7.0.3",
|
|
124
|
+
"eslint": "^7.32.0",
|
|
125
|
+
"eslint-config-chotot": "^21.0.0",
|
|
126
|
+
"eslint-import-resolver-babel-module": "^5.2.0",
|
|
127
|
+
"eslint-plugin-chotot": "^3.1.0",
|
|
128
|
+
"eslint-plugin-import": "^2.23.4",
|
|
129
|
+
"eslint-plugin-jsx-a11y": "^6.4.1",
|
|
130
|
+
"eslint-plugin-react": "^7.24.0",
|
|
131
|
+
"eslint-plugin-react-hooks": "^4.2.0",
|
|
132
|
+
"glob": "^7.1.6",
|
|
133
|
+
"husky": "^4.2.5",
|
|
134
|
+
"jest": "^26.6.3",
|
|
135
|
+
"linaria": "^1.4.0",
|
|
136
|
+
"lint-staged": "^10.5.4",
|
|
137
|
+
"lodash": "^4.17.21",
|
|
138
|
+
"node-fetch": "^2.6.1",
|
|
139
|
+
"npm-run-all": "^4.1.5",
|
|
140
|
+
"polished": "^3.6.5",
|
|
141
|
+
"prop-types": "^15.7.2",
|
|
142
|
+
"react": "^16.13.1",
|
|
143
|
+
"react-dom": "^16.13.1",
|
|
144
|
+
"react-is": "^16.13.1",
|
|
145
|
+
"react-laag": "^2.0.2",
|
|
146
|
+
"react-test-renderer": "^16.13.1",
|
|
147
|
+
"rimraf": "^3.0.2",
|
|
148
|
+
"sort-package-json": "^1.49.0",
|
|
149
|
+
"stylelint": "^13.11.0",
|
|
150
|
+
"stylelint-config-recommended": "^3.0.0",
|
|
151
|
+
"webpack": "^4.44.1"
|
|
152
|
+
},
|
|
153
|
+
"peerDependencies": {
|
|
154
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
|
155
|
+
"linaria": "^1.4.0",
|
|
156
|
+
"prop-types": "^15.7.2",
|
|
157
|
+
"react": "^16.0.0 || ^17.0.0",
|
|
158
|
+
"react-dom": "^16.0.0 || ^17.0.0",
|
|
159
|
+
"react-laag": "^2.0.2"
|
|
160
|
+
},
|
|
161
|
+
"engines": {
|
|
162
|
+
"node": ">=12",
|
|
163
|
+
"npm": ">=6"
|
|
164
|
+
},
|
|
165
|
+
"auto": {
|
|
166
|
+
"plugins": [
|
|
167
|
+
"npm",
|
|
168
|
+
"released"
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
"standard-version": {
|
|
172
|
+
"compareUrlFormat": "https://git.chotot.org/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
|
|
173
|
+
"commitUrlFormat": "https://git.chotot.org/{{owner}}/{{repository}}/commit/{{hash}}",
|
|
174
|
+
"skip": {
|
|
175
|
+
"tag": true
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default Dialog;
|
|
2
|
+
/**
|
|
3
|
+
* Dialog informs users about critical information or require decisions.
|
|
4
|
+
*
|
|
5
|
+
* `🧪Beta`
|
|
6
|
+
*
|
|
7
|
+
* @type {React.FC<{
|
|
8
|
+
* className?: string,
|
|
9
|
+
* title?: string,
|
|
10
|
+
* children?: any,
|
|
11
|
+
* btnLabel?: string,
|
|
12
|
+
* mainIcon?: any,
|
|
13
|
+
* desktopSize?: string,
|
|
14
|
+
* open?: boolean,
|
|
15
|
+
* onClose?: import('react').MouseEventHandler,
|
|
16
|
+
* closeIcon?: any,
|
|
17
|
+
* onButtonClick?: import('react').MouseEventHandler,
|
|
18
|
+
* }>}
|
|
19
|
+
*/
|
|
20
|
+
declare const Dialog: React.FC<{
|
|
21
|
+
className?: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
children?: any;
|
|
24
|
+
btnLabel?: string;
|
|
25
|
+
mainIcon?: any;
|
|
26
|
+
desktopSize?: string;
|
|
27
|
+
open?: boolean;
|
|
28
|
+
onClose?: import('react').MouseEventHandler;
|
|
29
|
+
closeIcon?: any;
|
|
30
|
+
onButtonClick?: import('react').MouseEventHandler;
|
|
31
|
+
}>;
|
|
32
|
+
import React from "react";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { cx } from 'linaria';
|
|
4
|
+
import createUniversalPortal from '../../utils/createUniversalPortal';
|
|
5
|
+
import Button from '../../components/Button/Button';
|
|
6
|
+
import { buttonClass, Backdrop } from '../Popup/Popup.styles';
|
|
7
|
+
import { DialogMainIcon, Modal, StyledDialog, CloseButton, ChildrenWrapper } from './Dialog.styles';
|
|
8
|
+
import Close from '../../icons/Close';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Dialog informs users about critical information or require decisions.
|
|
12
|
+
*
|
|
13
|
+
* `🧪Beta`
|
|
14
|
+
*
|
|
15
|
+
* @type {React.FC<{
|
|
16
|
+
* className?: string,
|
|
17
|
+
* title?: string,
|
|
18
|
+
* children?: any,
|
|
19
|
+
* btnLabel?: string,
|
|
20
|
+
* mainIcon?: any,
|
|
21
|
+
* desktopSize?: string,
|
|
22
|
+
* open?: boolean,
|
|
23
|
+
* onClose?: import('react').MouseEventHandler,
|
|
24
|
+
* closeIcon?: any,
|
|
25
|
+
* onButtonClick?: import('react').MouseEventHandler,
|
|
26
|
+
* }>}
|
|
27
|
+
*/
|
|
28
|
+
const Dialog = ({
|
|
29
|
+
className,
|
|
30
|
+
title,
|
|
31
|
+
children,
|
|
32
|
+
btnLabel,
|
|
33
|
+
mainIcon,
|
|
34
|
+
desktopSize,
|
|
35
|
+
open,
|
|
36
|
+
onClose,
|
|
37
|
+
closeIcon,
|
|
38
|
+
onButtonClick,
|
|
39
|
+
}) => {
|
|
40
|
+
const closeIconClass = cx(
|
|
41
|
+
(typeof closeIcon === 'string' || typeof closeIcon === 'number') && 'is-text'
|
|
42
|
+
);
|
|
43
|
+
const childrenWrapperClasses = cx(
|
|
44
|
+
(typeof children === 'string' || typeof children === 'number') && 'is-single-string',
|
|
45
|
+
typeof btnLabel === 'string' && !btnLabel.trim() && 'no-button'
|
|
46
|
+
);
|
|
47
|
+
/* eslint-disable react/jsx-no-useless-fragment */
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
{open &&
|
|
51
|
+
createUniversalPortal(
|
|
52
|
+
<Modal>
|
|
53
|
+
<Backdrop onClick={onClose} />
|
|
54
|
+
<StyledDialog className={cx(className, desktopSize)}>
|
|
55
|
+
<div className="main-icon">{mainIcon}</div>
|
|
56
|
+
<CloseButton type="button" className={closeIconClass} onClick={onClose}>
|
|
57
|
+
{closeIcon}
|
|
58
|
+
</CloseButton>
|
|
59
|
+
<h5>{title}</h5>
|
|
60
|
+
<ChildrenWrapper className={childrenWrapperClasses}>{children}</ChildrenWrapper>
|
|
61
|
+
<Button color="accent" extraClasses={buttonClass} onClick={onButtonClick}>
|
|
62
|
+
{btnLabel}
|
|
63
|
+
</Button>
|
|
64
|
+
</StyledDialog>
|
|
65
|
+
</Modal>
|
|
66
|
+
)}
|
|
67
|
+
</>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
Dialog.propTypes = {
|
|
72
|
+
/**
|
|
73
|
+
* Dialog className (can be used to add more styles to mainIcon by targeting `main-icon` class in case of using a custom string)
|
|
74
|
+
*/
|
|
75
|
+
className: PropTypes.string,
|
|
76
|
+
/**
|
|
77
|
+
* Dialog title
|
|
78
|
+
*/
|
|
79
|
+
title: PropTypes.string,
|
|
80
|
+
/**
|
|
81
|
+
* Dialog content
|
|
82
|
+
*/
|
|
83
|
+
children: PropTypes.oneOfType([
|
|
84
|
+
PropTypes.element,
|
|
85
|
+
PropTypes.arrayOf(PropTypes.element),
|
|
86
|
+
PropTypes.string,
|
|
87
|
+
]).isRequired,
|
|
88
|
+
/**
|
|
89
|
+
* Dialog max-width on desktop
|
|
90
|
+
*/
|
|
91
|
+
desktopSize: PropTypes.oneOf(['md', 'lg', 'xl']),
|
|
92
|
+
/**
|
|
93
|
+
* Dialog button label
|
|
94
|
+
*/
|
|
95
|
+
btnLabel: PropTypes.string,
|
|
96
|
+
/**
|
|
97
|
+
* Dialog main icon. It can be changed by passing another `React component` or a `string`.
|
|
98
|
+
*/
|
|
99
|
+
mainIcon: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
|
|
100
|
+
/**
|
|
101
|
+
* Whether this Dialog is open or not
|
|
102
|
+
*/
|
|
103
|
+
open: PropTypes.bool,
|
|
104
|
+
/**
|
|
105
|
+
* Dialog close icon on the right. Default is **`X`** mark icon. It can be changed by passing another `React component` or a `string`.
|
|
106
|
+
*/
|
|
107
|
+
closeIcon: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
|
|
108
|
+
/**
|
|
109
|
+
* Callback when close icon is clicked. Normally, it is used to update `open` prop to close the dialog.
|
|
110
|
+
*/
|
|
111
|
+
onClose: PropTypes.func,
|
|
112
|
+
/**
|
|
113
|
+
* Callback when dialog main button is clicked
|
|
114
|
+
*/
|
|
115
|
+
onButtonClick: PropTypes.func,
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
Dialog.defaultProps = {
|
|
119
|
+
className: '',
|
|
120
|
+
title: '',
|
|
121
|
+
btnLabel: '',
|
|
122
|
+
mainIcon: <DialogMainIcon />,
|
|
123
|
+
desktopSize: 'lg',
|
|
124
|
+
open: false,
|
|
125
|
+
onClose: () => {},
|
|
126
|
+
closeIcon: <Close />,
|
|
127
|
+
onButtonClick: () => {},
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export default Dialog;
|