polpo 0.1.0
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/.eslintrc.cjs +9 -0
- package/.storybook/decorators.tsx +61 -0
- package/.storybook/main.ts +47 -0
- package/.storybook/manager-head.html +2 -0
- package/.storybook/manager.ts +7 -0
- package/.storybook/preview-head.html +2 -0
- package/.storybook/preview.ts +38 -0
- package/.storybook/theme.ts +47 -0
- package/.turbo/daemon/f5c5c8fb195b01d0-turbo.log.2024-05-26 +0 -0
- package/.turbo/turbo-build$colon$watch.log +96 -0
- package/.turbo/turbo-build-storybook.log +0 -0
- package/.turbo/turbo-build.log +77 -0
- package/.turbo/turbo-lint$colon$fix.log +2 -0
- package/.turbo/turbo-lint.log +4 -0
- package/README.md +68 -0
- package/dist/chunk-M4KRSYE7.js +3 -0
- package/dist/chunk-M4KRSYE7.js.map +1 -0
- package/dist/chunk-U5XSMSKZ.js +3 -0
- package/dist/chunk-U5XSMSKZ.js.map +1 -0
- package/dist/get-modal-position-DPftPoU2.d.cts +28 -0
- package/dist/get-modal-position-DPftPoU2.d.ts +28 -0
- package/dist/helpers.cjs +3 -0
- package/dist/helpers.cjs.map +1 -0
- package/dist/helpers.d.cts +15 -0
- package/dist/helpers.d.ts +15 -0
- package/dist/helpers.js +3 -0
- package/dist/helpers.js.map +1 -0
- package/dist/hooks.cjs +3 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.cts +121 -0
- package/dist/hooks.d.ts +121 -0
- package/dist/hooks.js +3 -0
- package/dist/hooks.js.map +1 -0
- package/dist/ui.cjs +1987 -0
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.cts +3932 -0
- package/dist/ui.d.ts +3932 -0
- package/dist/ui.js +1987 -0
- package/dist/ui.js.map +1 -0
- package/package.json +98 -0
- package/src/components/accordion/accordion-item.stories.tsx +128 -0
- package/src/components/accordion/accordion-item.tsx +119 -0
- package/src/components/accordion/accordion.stories.tsx +74 -0
- package/src/components/accordion/accordion.style.ts +42 -0
- package/src/components/accordion/accordion.tsx +56 -0
- package/src/components/accordion/index.ts +2 -0
- package/src/components/buttons/button/button.stories.tsx +103 -0
- package/src/components/buttons/button/button.style.ts +147 -0
- package/src/components/buttons/button/button.tsx +119 -0
- package/src/components/buttons/button/index.ts +1 -0
- package/src/components/buttons/index.ts +1 -0
- package/src/components/cards/flip-card/flip-card.stories.tsx +61 -0
- package/src/components/cards/flip-card/flip-card.style.ts +45 -0
- package/src/components/cards/flip-card/flip-card.tsx +55 -0
- package/src/components/cards/flip-card/index.ts +1 -0
- package/src/components/cards/hover-card/hover-card.stories.tsx +45 -0
- package/src/components/cards/hover-card/hover-card.style.ts +13 -0
- package/src/components/cards/hover-card/hover-card.tsx +71 -0
- package/src/components/cards/hover-card/index.ts +1 -0
- package/src/components/cards/index.ts +3 -0
- package/src/components/cards/slide-card/index.ts +1 -0
- package/src/components/cards/slide-card/slide-card.stories.tsx +47 -0
- package/src/components/cards/slide-card/slide-card.tsx +42 -0
- package/src/components/form/checkbox/checkbox.stories.tsx +34 -0
- package/src/components/form/checkbox/checkbox.style.ts +75 -0
- package/src/components/form/checkbox/checkbox.tsx +76 -0
- package/src/components/form/checkbox/index.ts +1 -0
- package/src/components/form/controller/controller.tsx +42 -0
- package/src/components/form/controller/index.ts +1 -0
- package/src/components/form/date-picker/date-picker.stories.tsx +38 -0
- package/src/components/form/date-picker/date-picker.tsx +67 -0
- package/src/components/form/date-picker/index.ts +1 -0
- package/src/components/form/field/field.stories.tsx +49 -0
- package/src/components/form/field/field.style.ts +79 -0
- package/src/components/form/field/field.tsx +83 -0
- package/src/components/form/field/field.types.ts +28 -0
- package/src/components/form/field/index.ts +2 -0
- package/src/components/form/form.stories.types.tsx +50 -0
- package/src/components/form/form.types.ts +37 -0
- package/src/components/form/index.ts +14 -0
- package/src/components/form/input/index.ts +1 -0
- package/src/components/form/input/input.stories.tsx +41 -0
- package/src/components/form/input/input.tsx +73 -0
- package/src/components/form/input-color/index.ts +1 -0
- package/src/components/form/input-color/input-color.stories.tsx +46 -0
- package/src/components/form/input-color/input-color.style.ts +93 -0
- package/src/components/form/input-color/input-color.tsx +159 -0
- package/src/components/form/input-file/index.ts +1 -0
- package/src/components/form/input-file/input-file.stories.tsx +40 -0
- package/src/components/form/input-file/input-file.style.ts +143 -0
- package/src/components/form/input-file/input-file.tsx +214 -0
- package/src/components/form/input-password/index.ts +1 -0
- package/src/components/form/input-password/input-password.stories.tsx +37 -0
- package/src/components/form/input-password/input-password.tsx +83 -0
- package/src/components/form/radio/index.ts +1 -0
- package/src/components/form/radio/radio.stories.tsx +43 -0
- package/src/components/form/radio/radio.style.ts +58 -0
- package/src/components/form/radio/radio.tsx +76 -0
- package/src/components/form/select/index.ts +1 -0
- package/src/components/form/select/options.tsx +140 -0
- package/src/components/form/select/select-option.tsx +84 -0
- package/src/components/form/select/select.stories.tsx +89 -0
- package/src/components/form/select/select.style.ts +164 -0
- package/src/components/form/select/select.tsx +327 -0
- package/src/components/form/select/select.types.ts +93 -0
- package/src/components/form/slider/index.ts +1 -0
- package/src/components/form/slider/slider.stories.tsx +40 -0
- package/src/components/form/slider/slider.style.ts +90 -0
- package/src/components/form/slider/slider.tsx +108 -0
- package/src/components/form/switch/index.ts +1 -0
- package/src/components/form/switch/switch.stories.tsx +38 -0
- package/src/components/form/switch/switch.style.ts +120 -0
- package/src/components/form/switch/switch.tsx +111 -0
- package/src/components/form/textarea/index.ts +1 -0
- package/src/components/form/textarea/textarea.stories.tsx +43 -0
- package/src/components/form/textarea/textarea.style.ts +7 -0
- package/src/components/form/textarea/textarea.tsx +76 -0
- package/src/components/icon/icon.stories.tsx +63 -0
- package/src/components/icon/icon.tsx +64 -0
- package/src/components/icon/icons/index.ts +18 -0
- package/src/components/icon/icons/object.tsx +482 -0
- package/src/components/icon/icons/social.tsx +72 -0
- package/src/components/icon/icons/symbol.tsx +776 -0
- package/src/components/icon/index.ts +5 -0
- package/src/components/image/image.stories.tsx +25 -0
- package/src/components/image/image.tsx +7 -0
- package/src/components/image/index.ts +1 -0
- package/src/components/index.ts +16 -0
- package/src/components/infinity-scroll/index.ts +1 -0
- package/src/components/infinity-scroll/infinity-scroll.stories.tsx +75 -0
- package/src/components/infinity-scroll/infinity-scroll.style.ts +30 -0
- package/src/components/infinity-scroll/infinity-scroll.tsx +56 -0
- package/src/components/line/index.ts +1 -0
- package/src/components/line/line.stories.tsx +67 -0
- package/src/components/line/line.style.ts +57 -0
- package/src/components/line/line.tsx +76 -0
- package/src/components/loaders/index.ts +1 -0
- package/src/components/loaders/simple-loader/index.ts +1 -0
- package/src/components/loaders/simple-loader/simple-loader.stories.tsx +21 -0
- package/src/components/loaders/simple-loader/simple-loader.style.ts +13 -0
- package/src/components/loaders/simple-loader/simple-loader.tsx +15 -0
- package/src/components/modals/action-modal/action-modal.stories.tsx +134 -0
- package/src/components/modals/action-modal/action-modal.style.ts +129 -0
- package/src/components/modals/action-modal/action-modal.tsx +150 -0
- package/src/components/modals/action-modal/index.ts +1 -0
- package/src/components/modals/aside-modal/aside-modal.stories.tsx +82 -0
- package/src/components/modals/aside-modal/aside-modal.style.ts +108 -0
- package/src/components/modals/aside-modal/aside-modal.tsx +66 -0
- package/src/components/modals/aside-modal/index.ts +1 -0
- package/src/components/modals/confirmation-modal/confirmation-modal.stories.tsx +50 -0
- package/src/components/modals/confirmation-modal/confirmation-modal.style.ts +17 -0
- package/src/components/modals/confirmation-modal/confirmation-modal.tsx +43 -0
- package/src/components/modals/confirmation-modal/index.ts +1 -0
- package/src/components/modals/index.ts +4 -0
- package/src/components/modals/modal/index.ts +1 -0
- package/src/components/modals/modal/modal.style.ts +10 -0
- package/src/components/modals/modal/modal.tsx +132 -0
- package/src/components/ripple/index.ts +1 -0
- package/src/components/ripple/ripple.stories.tsx +38 -0
- package/src/components/ripple/ripple.style.ts +33 -0
- package/src/components/ripple/ripple.tsx +63 -0
- package/src/components/smart-table/index.ts +1 -0
- package/src/components/smart-table/smart-table.column.tsx +63 -0
- package/src/components/smart-table/smart-table.helpers.tsx +59 -0
- package/src/components/smart-table/smart-table.hooks.ts +27 -0
- package/src/components/smart-table/smart-table.row.tsx +29 -0
- package/src/components/smart-table/smart-table.stories.tsx +301 -0
- package/src/components/smart-table/smart-table.style.ts +102 -0
- package/src/components/smart-table/smart-table.tsx +112 -0
- package/src/components/smart-table/smart-table.types.ts +41 -0
- package/src/components/tabs/index.ts +1 -0
- package/src/components/tabs/tabs-container.stories.tsx +159 -0
- package/src/components/tabs/tabs-list.tsx +131 -0
- package/src/components/tabs/tabs.stories.tsx +68 -0
- package/src/components/tabs/tabs.style.ts +132 -0
- package/src/components/tabs/tabs.tsx +117 -0
- package/src/components/tag/index.ts +1 -0
- package/src/components/tag/tag.stories.tsx +49 -0
- package/src/components/tag/tag.style.ts +24 -0
- package/src/components/tag/tag.tsx +44 -0
- package/src/components/tooltips/click-to-copy/click-to-copy.stories.tsx +39 -0
- package/src/components/tooltips/click-to-copy/click-to-copy.tsx +41 -0
- package/src/components/tooltips/click-to-copy/index.ts +1 -0
- package/src/components/tooltips/index.ts +2 -0
- package/src/components/tooltips/tooltip/index.ts +1 -0
- package/src/components/tooltips/tooltip/tooltip.stories.tsx +35 -0
- package/src/components/tooltips/tooltip/tooltip.style.ts +62 -0
- package/src/components/tooltips/tooltip/tooltip.tsx +45 -0
- package/src/components/typography/index.ts +2 -0
- package/src/components/typography/typography.constants.ts +43 -0
- package/src/components/typography/typography.stories.tsx +106 -0
- package/src/components/typography/typography.style.ts +76 -0
- package/src/components/typography/typography.tsx +79 -0
- package/src/contexts/fetch-context/fetch-context.tsx +114 -0
- package/src/contexts/fetch-context/index.ts +1 -0
- package/src/contexts/form-context/form-context.tsx +43 -0
- package/src/contexts/form-context/index.ts +1 -0
- package/src/contexts/index.ts +3 -0
- package/src/contexts/theme-context/index.ts +3 -0
- package/src/contexts/theme-context/theme-context.tsx +158 -0
- package/src/contexts/theme-context/theme.animations.ts +180 -0
- package/src/contexts/theme-context/theme.defaults.ts +205 -0
- package/src/contexts/theme-context/theme.style.ts +78 -0
- package/src/contexts/theme-context/themes.ts +96 -0
- package/src/core/http-client.d.ts +11 -0
- package/src/core/http-client.d.ts.map +1 -0
- package/src/core/http-client.ts +47 -0
- package/src/core/index.d.ts +2 -0
- package/src/core/index.d.ts.map +1 -0
- package/src/core/index.ts +1 -0
- package/src/core/variants/color.ts +36 -0
- package/src/core/variants/index.ts +3 -0
- package/src/core/variants/radius.ts +56 -0
- package/src/core/variants/size.ts +44 -0
- package/src/helpers/format-bytes.ts +11 -0
- package/src/helpers/format-dates.ts +11 -0
- package/src/helpers/get-modal-position.ts +66 -0
- package/src/helpers/index.ts +4 -0
- package/src/helpers/text/index.ts +1 -0
- package/src/helpers/text/to-capitalize.ts +17 -0
- package/src/hooks/index.ts +23 -0
- package/src/hooks/use-async.ts +88 -0
- package/src/hooks/use-classnames.ts +13 -0
- package/src/hooks/use-constant.ts +3 -0
- package/src/hooks/use-debounce.ts +15 -0
- package/src/hooks/use-dimensions.ts +22 -0
- package/src/hooks/use-event-listener.ts +71 -0
- package/src/hooks/use-file-reader.ts +69 -0
- package/src/hooks/use-hover.ts +17 -0
- package/src/hooks/use-in-view.ts +20 -0
- package/src/hooks/use-input-handlers.ts +49 -0
- package/src/hooks/use-media-query.ts +25 -0
- package/src/hooks/use-modal-in-container.ts +94 -0
- package/src/hooks/use-mouse-position.ts +16 -0
- package/src/hooks/use-observer.ts +18 -0
- package/src/hooks/use-on-click-outside-ref.ts +17 -0
- package/src/hooks/use-online-status.ts +12 -0
- package/src/hooks/use-render-count.ts +11 -0
- package/src/hooks/use-safe-dispatch.ts +22 -0
- package/src/hooks/use-scroll.ts +31 -0
- package/src/hooks/use-state-history.ts +22 -0
- package/src/hooks/use-toggle-values.ts +14 -0
- package/src/hooks/use-toggle.ts +11 -0
- package/src/hooks/use-viewport.ts +38 -0
- package/src/index.ts +5 -0
- package/src/layouts/flex/flex.tsx +75 -0
- package/src/layouts/flex/index.ts +1 -0
- package/src/layouts/grid/grid.tsx +86 -0
- package/src/layouts/grid/index.ts +1 -0
- package/src/layouts/index.ts +3 -0
- package/src/layouts/section-layout/index.ts +1 -0
- package/src/layouts/section-layout/section-layout.stories.tsx +55 -0
- package/src/layouts/section-layout/section-layout.style.ts +21 -0
- package/src/layouts/section-layout/section-layout.tsx +46 -0
- package/src/stories/GettingStarted.mdx +66 -0
- package/src/types/generics.ts +68 -0
- package/src/types/index.ts +1 -0
- package/svg/Name=airplane, Category=object.svg +3 -0
- package/svg/Name=arrow-circle, Category=symbol.svg +3 -0
- package/svg/Name=arrow-down, Category=symbol.svg +3 -0
- package/svg/Name=arrow-left, Category=symbol.svg +3 -0
- package/svg/Name=arrow-right, Category=symbol.svg +3 -0
- package/svg/Name=arrow-up, Category=symbol.svg +3 -0
- package/svg/Name=bell, Category=object.svg +3 -0
- package/svg/Name=bicycle, Category=object.svg +3 -0
- package/svg/Name=book-open, Category=object.svg +3 -0
- package/svg/Name=book-solid, Category=object.svg +6 -0
- package/svg/Name=box-shadow, Category=symbol.svg +5 -0
- package/svg/Name=calendar, Category=object.svg +3 -0
- package/svg/Name=camera, Category=object.svg +3 -0
- package/svg/Name=caret-down, Category=symbol.svg +3 -0
- package/svg/Name=caret-left, Category=symbol.svg +3 -0
- package/svg/Name=caret-right, Category=symbol.svg +3 -0
- package/svg/Name=caret-up, Category=symbol.svg +3 -0
- package/svg/Name=checkmark, Category=symbol.svg +3 -0
- package/svg/Name=clean-computer, Category=object.svg +10 -0
- package/svg/Name=codepen, Category=social.svg +3 -0
- package/svg/Name=creative, Category=symbol.svg +5 -0
- package/svg/Name=cross, Category=symbol.svg +4 -0
- package/svg/Name=crossed-flags, Category=object.svg +4 -0
- package/svg/Name=cv, Category=symbol.svg +5 -0
- package/svg/Name=design-ui, Category=symbol.svg +9 -0
- package/svg/Name=document, Category=object.svg +3 -0
- package/svg/Name=door-closed, Category=object.svg +3 -0
- package/svg/Name=door-open, Category=object.svg +3 -0
- package/svg/Name=double-caret-down, Category=symbol.svg +4 -0
- package/svg/Name=double-caret-left, Category=symbol.svg +4 -0
- package/svg/Name=double-caret-righ, Category=symbol.svg +4 -0
- package/svg/Name=double-caret-up, Category=symbol.svg +4 -0
- package/svg/Name=download, Category=symbol.svg +5 -0
- package/svg/Name=dropper, Category=object.svg +5 -0
- package/svg/Name=envelope, Category=object.svg +3 -0
- package/svg/Name=exclamation-close, Category=symbol.svg +4 -0
- package/svg/Name=exclamation-open, Category=symbol.svg +4 -0
- package/svg/Name=external-link, Category=symbol.svg +3 -0
- package/svg/Name=eye, Category=object.svg +4 -0
- package/svg/Name=eye-hidden, Category=object.svg +7 -0
- package/svg/Name=facebook, Category=social.svg +3 -0
- package/svg/Name=form, Category=symbol.svg +8 -0
- package/svg/Name=game-control, Category=object.svg +3 -0
- package/svg/Name=gear, Category=object.svg +3 -0
- package/svg/Name=github, Category=social.svg +3 -0
- package/svg/Name=house, Category=object.svg +3 -0
- package/svg/Name=hyphen, Category=symbol.svg +3 -0
- package/svg/Name=info, Category=symbol.svg +3 -0
- package/svg/Name=instagram, Category=social.svg +3 -0
- package/svg/Name=link, Category=symbol.svg +5 -0
- package/svg/Name=linkedin, Category=social.svg +3 -0
- package/svg/Name=magnifying-glass, Category=object.svg +3 -0
- package/svg/Name=message, Category=symbol.svg +4 -0
- package/svg/Name=moon, Category=object.svg +5 -0
- package/svg/Name=order-list, Category=symbol.svg +7 -0
- package/svg/Name=pencil, Category=object.svg +3 -0
- package/svg/Name=pin-location, Category=symbol.svg +3 -0
- package/svg/Name=question-mark-close, Category=symbol.svg +3 -0
- package/svg/Name=question-mark-open, Category=symbol.svg +3 -0
- package/svg/Name=share, Category=symbol.svg +5 -0
- package/svg/Name=spinner, Category=symbol.svg +9 -0
- package/svg/Name=star, Category=object.svg +3 -0
- package/svg/Name=star-empty, Category=object.svg +3 -0
- package/svg/Name=sun, Category=object.svg +11 -0
- package/svg/Name=text-shadow, Category=symbol.svg +4 -0
- package/svg/Name=thinking, Category=symbol.svg +3 -0
- package/svg/Name=trash-can, Category=object.svg +4 -0
- package/svg/Name=upload, Category=symbol.svg +5 -0
- package/svg/Name=user, Category=symbol.svg +4 -0
- package/svg/Name=warning, Category=symbol.svg +5 -0
- package/svg/Name=whatsapp, Category=social.svg +3 -0
- package/svgconfig.json +4 -0
- package/tsconfig.json +14 -0
- package/tsup.config.cjs +21 -0
- package/vite.config.ts +13 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Image } from './image';
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Image> = {
|
|
6
|
+
title: 'Image',
|
|
7
|
+
component: Image,
|
|
8
|
+
argTypes: {
|
|
9
|
+
src: { control: { type: 'text' } },
|
|
10
|
+
alt: { control: { type: 'text' } },
|
|
11
|
+
loading: { control: 'select', options: ['eager', 'lazy'] },
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
src: 'https://t4.ftcdn.net/jpg/07/28/89/61/360_F_728896171_M2pPUCPkTyFiSYWhDsJI5A45TsI6B5Gk.jpg',
|
|
15
|
+
alt: 'Image',
|
|
16
|
+
loading: 'eager',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof Image>;
|
|
22
|
+
|
|
23
|
+
export const Default: Story = {
|
|
24
|
+
args: {},
|
|
25
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DetailedHTMLProps, ImgHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
type ImageProps = DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> & {};
|
|
4
|
+
|
|
5
|
+
export const Image = ({ alt = '', loading = 'eager', ...props }: ImageProps) => {
|
|
6
|
+
return <img loading={loading} alt={alt} {...props} width='100%' />;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './image';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './accordion';
|
|
2
|
+
export * from './buttons';
|
|
3
|
+
export * from './cards';
|
|
4
|
+
export * from './form';
|
|
5
|
+
export * from './icon';
|
|
6
|
+
export * from './image';
|
|
7
|
+
export * from './infinity-scroll';
|
|
8
|
+
export * from './line';
|
|
9
|
+
export * from './loaders';
|
|
10
|
+
export * from './modals';
|
|
11
|
+
export * from './ripple';
|
|
12
|
+
export * from './smart-table';
|
|
13
|
+
export * from './tabs';
|
|
14
|
+
export * from './tag';
|
|
15
|
+
export * from './tooltips';
|
|
16
|
+
export * from './typography';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './infinity-scroll';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Grid } from '../../layouts';
|
|
4
|
+
import { Typography } from '../typography';
|
|
5
|
+
|
|
6
|
+
import { InfinityScroll } from './infinity-scroll';
|
|
7
|
+
|
|
8
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
9
|
+
|
|
10
|
+
const meta: Meta<typeof InfinityScroll> = {
|
|
11
|
+
title: 'InfinityScroll',
|
|
12
|
+
component: InfinityScroll,
|
|
13
|
+
argTypes: {
|
|
14
|
+
isLoading: { control: 'boolean' },
|
|
15
|
+
hasNextPage: { control: 'boolean' },
|
|
16
|
+
loadMore: { control: false },
|
|
17
|
+
data: { control: false },
|
|
18
|
+
renderItem: { control: false },
|
|
19
|
+
customLoadMoreElement: { control: false },
|
|
20
|
+
emptyMessage: { control: 'text' },
|
|
21
|
+
children: { control: 'text' },
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
renderItem: (item, key) => <p key={key}>{item as string}</p>,
|
|
25
|
+
},
|
|
26
|
+
decorators: [
|
|
27
|
+
Story => (
|
|
28
|
+
<Grid style={{ height: '300px', width: '300px', overflow: 'auto', border: '1px solid' }}>
|
|
29
|
+
<Story />
|
|
30
|
+
</Grid>
|
|
31
|
+
),
|
|
32
|
+
],
|
|
33
|
+
render: args => {
|
|
34
|
+
const [data, setData] = useState<Array<string>>([]);
|
|
35
|
+
const [hasNextPage, setHasNextPage] = useState(true);
|
|
36
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
37
|
+
|
|
38
|
+
const loadMore = useCallback(() => {
|
|
39
|
+
if (!hasNextPage) return;
|
|
40
|
+
|
|
41
|
+
setIsLoading(true);
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
setData([...data, ...['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']]);
|
|
44
|
+
setHasNextPage(data.length < 100);
|
|
45
|
+
setIsLoading(false);
|
|
46
|
+
}, 1000);
|
|
47
|
+
}, [data, hasNextPage]);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Grid gap='10px' style={{ padding: '10px' }}>
|
|
51
|
+
<InfinityScroll
|
|
52
|
+
{...args}
|
|
53
|
+
data={data}
|
|
54
|
+
hasNextPage={hasNextPage}
|
|
55
|
+
isLoading={isLoading}
|
|
56
|
+
loadMore={loadMore}
|
|
57
|
+
renderItem={(v: string) => (
|
|
58
|
+
<section style={{ padding: '10px', background: '#55882233' }}>
|
|
59
|
+
<Typography variant='label' weight='bold' align='center' as='p'>
|
|
60
|
+
{v}
|
|
61
|
+
</Typography>
|
|
62
|
+
</section>
|
|
63
|
+
)}
|
|
64
|
+
/>
|
|
65
|
+
</Grid>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export default meta;
|
|
71
|
+
type Story = StoryObj<typeof InfinityScroll>;
|
|
72
|
+
|
|
73
|
+
export const Default: Story = {
|
|
74
|
+
args: {},
|
|
75
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export const InfiniteScrollStyle = styled.section`
|
|
4
|
+
display: grid;
|
|
5
|
+
gap: 1em;
|
|
6
|
+
`;
|
|
7
|
+
|
|
8
|
+
export const InfinityScrollFooterStyle = styled.section`
|
|
9
|
+
display: grid;
|
|
10
|
+
place-content: start center;
|
|
11
|
+
place-items: start center;
|
|
12
|
+
|
|
13
|
+
.loading {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 30px;
|
|
16
|
+
display: grid;
|
|
17
|
+
place-content: center;
|
|
18
|
+
|
|
19
|
+
&--icon {
|
|
20
|
+
animation: spin 0.5s linear infinite;
|
|
21
|
+
font-size: 20px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.empty-message {
|
|
26
|
+
font-size: 0.8em;
|
|
27
|
+
text-align: center;
|
|
28
|
+
color: #a6a6a6;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { LegacyRef, RefObject, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Icon } from '../icon';
|
|
4
|
+
|
|
5
|
+
import { InfinityScrollFooterStyle } from './infinity-scroll.style';
|
|
6
|
+
|
|
7
|
+
import { useDebounce, useInView } from '@polpo/hooks';
|
|
8
|
+
|
|
9
|
+
type InfinityScrollProps<T> = {
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
hasNextPage: boolean;
|
|
12
|
+
loadMore: () => void;
|
|
13
|
+
data: Array<T>;
|
|
14
|
+
renderItem: (item: T, key: number) => React.ReactElement;
|
|
15
|
+
customLoadMoreElement?: (ref: RefObject<Element>) => React.ReactElement;
|
|
16
|
+
emptyMessage?: string;
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const InfinityScroll = <T,>({
|
|
21
|
+
isLoading: isLoadingProp = false,
|
|
22
|
+
hasNextPage = false,
|
|
23
|
+
loadMore,
|
|
24
|
+
data = [],
|
|
25
|
+
renderItem,
|
|
26
|
+
customLoadMoreElement,
|
|
27
|
+
emptyMessage,
|
|
28
|
+
children,
|
|
29
|
+
}: InfinityScrollProps<T>): React.ReactElement => {
|
|
30
|
+
const { ref, inView } = useInView();
|
|
31
|
+
const isLoading = useDebounce(isLoadingProp, 100);
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (hasNextPage && inView && !isLoading) {
|
|
35
|
+
loadMore();
|
|
36
|
+
}
|
|
37
|
+
}, [hasNextPage, isLoading, loadMore, inView]);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
{children}
|
|
42
|
+
{data.map(renderItem)}
|
|
43
|
+
<InfinityScrollFooterStyle>
|
|
44
|
+
{!!emptyMessage && data.length === 0 && !isLoading && <p className='empty-message'>{emptyMessage}</p>}
|
|
45
|
+
{(hasNextPage || isLoading) &&
|
|
46
|
+
(customLoadMoreElement ? (
|
|
47
|
+
customLoadMoreElement(ref)
|
|
48
|
+
) : (
|
|
49
|
+
<section ref={ref as LegacyRef<HTMLElement>} className='loading'>
|
|
50
|
+
{isLoading && <Icon name='spinner' className='loading--icon' />}
|
|
51
|
+
</section>
|
|
52
|
+
))}
|
|
53
|
+
</InfinityScrollFooterStyle>
|
|
54
|
+
</>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './line';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Grid } from '../../layouts';
|
|
2
|
+
import { Typography } from '../typography';
|
|
3
|
+
|
|
4
|
+
import { Line, LineOrientation, LineStyle } from './line';
|
|
5
|
+
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof Line> = {
|
|
9
|
+
title: 'Line',
|
|
10
|
+
component: Line,
|
|
11
|
+
argTypes: {
|
|
12
|
+
orientation: { control: false },
|
|
13
|
+
className: { control: false },
|
|
14
|
+
style: { control: false },
|
|
15
|
+
color: { control: 'color' },
|
|
16
|
+
lineStyle: { control: false },
|
|
17
|
+
lineWidth: { control: { type: 'range', min: 1, max: 10 }, if: { arg: 'lineStyle', neq: LineStyle.DOTTED } },
|
|
18
|
+
dotSize: { control: { type: 'range', min: 1, max: 100 }, if: { arg: 'lineStyle', eq: LineStyle.DOTTED } },
|
|
19
|
+
dashedSize: { control: { type: 'range', min: 1, max: 100 }, if: { arg: 'lineStyle', eq: LineStyle.DASHED } },
|
|
20
|
+
spacing: { control: { type: 'range', min: 1, max: 100 }, if: { arg: 'lineStyle', neq: LineStyle.SOLID } },
|
|
21
|
+
},
|
|
22
|
+
args: {
|
|
23
|
+
color: 'currentColor',
|
|
24
|
+
},
|
|
25
|
+
render: (args, { orientation }) => <Line {...args} orientation={orientation} />,
|
|
26
|
+
decorators: [
|
|
27
|
+
Story => (
|
|
28
|
+
<Grid ac='start' gtr='auto 1fr auto auto' gap='0.5em' style={{ width: '300px', height: '300px' }}>
|
|
29
|
+
<Typography variant='small' noPadding>
|
|
30
|
+
Vertical
|
|
31
|
+
</Typography>
|
|
32
|
+
<Story orientation={LineOrientation.VERTICAL} />
|
|
33
|
+
<Typography variant='small' noPadding>
|
|
34
|
+
Horizontal
|
|
35
|
+
</Typography>
|
|
36
|
+
<Story orientation={LineOrientation.HORIZONTAL} />
|
|
37
|
+
</Grid>
|
|
38
|
+
),
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default meta;
|
|
43
|
+
type Story = StoryObj<typeof Line>;
|
|
44
|
+
|
|
45
|
+
export const Solid: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
lineStyle: LineStyle.SOLID,
|
|
48
|
+
lineWidth: 1,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Dotted: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
lineStyle: LineStyle.DOTTED,
|
|
55
|
+
dotSize: 2,
|
|
56
|
+
spacing: 5,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const Dashed: Story = {
|
|
61
|
+
args: {
|
|
62
|
+
lineStyle: LineStyle.DASHED,
|
|
63
|
+
lineWidth: 2,
|
|
64
|
+
dashedSize: 10,
|
|
65
|
+
spacing: 15,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export type LineStyleProps = {
|
|
4
|
+
$color: string;
|
|
5
|
+
$size: number;
|
|
6
|
+
$spacing: number;
|
|
7
|
+
$dashSize: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const LineStyle = styled.span<LineStyleProps>`
|
|
11
|
+
&.horizontal,
|
|
12
|
+
&.vertical {
|
|
13
|
+
background: ${props => props.$color ?? 'currentColor'};
|
|
14
|
+
display: inline-block;
|
|
15
|
+
border-radius: 100px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.horizontal {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: ${props => props.$size}px;
|
|
21
|
+
${({ $size: sz, $spacing: sp, $color: cl, $dashSize: ds }) => css`
|
|
22
|
+
&.dotted {
|
|
23
|
+
background: radial-gradient(${sz / 2}px ${sz / 2}px, ${cl} 100%, transparent) 0 0 / ${sp + sz}px 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.dashed {
|
|
27
|
+
background: repeating-linear-gradient(
|
|
28
|
+
90deg,
|
|
29
|
+
${cl},
|
|
30
|
+
${cl} ${ds}px,
|
|
31
|
+
transparent ${ds}px,
|
|
32
|
+
transparent ${sp + ds}px
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
`}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.vertical {
|
|
39
|
+
height: 100%;
|
|
40
|
+
width: ${props => props.$size}px;
|
|
41
|
+
${({ $size: sz, $spacing: sp, $color: cl, $dashSize: ds }) => css`
|
|
42
|
+
&.dotted {
|
|
43
|
+
background: radial-gradient(${sz / 2}px ${sz / 2}px, ${cl} 100%, transparent) 0 0 / 100% ${sp + sz}px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.dashed {
|
|
47
|
+
background: repeating-linear-gradient(
|
|
48
|
+
0deg,
|
|
49
|
+
${cl},
|
|
50
|
+
${cl} ${ds}px,
|
|
51
|
+
transparent ${ds}px,
|
|
52
|
+
transparent ${sp + ds}px
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
`}
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { LineStyle as LineComponentStyle } from './line.style';
|
|
2
|
+
|
|
3
|
+
import { useClassNames } from '@polpo/hooks';
|
|
4
|
+
|
|
5
|
+
export enum LineOrientation {
|
|
6
|
+
VERTICAL = 'vertical',
|
|
7
|
+
HORIZONTAL = 'horizontal',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum LineStyle {
|
|
11
|
+
SOLID = 'solid',
|
|
12
|
+
DOTTED = 'dotted',
|
|
13
|
+
DASHED = 'dashed',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type LineCommonProps = {
|
|
17
|
+
orientation?: `${LineOrientation}`;
|
|
18
|
+
className?: string;
|
|
19
|
+
style?: React.CSSProperties;
|
|
20
|
+
color?: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type LineSolidProps = LineCommonProps & {
|
|
24
|
+
lineStyle?: `${LineStyle.SOLID}`;
|
|
25
|
+
spacing?: never;
|
|
26
|
+
dotSize?: never;
|
|
27
|
+
dashedSize?: never;
|
|
28
|
+
lineWidth?: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type LineDottedProps = LineCommonProps & {
|
|
32
|
+
lineStyle: `${LineStyle.DOTTED}`;
|
|
33
|
+
spacing?: number;
|
|
34
|
+
dotSize?: number;
|
|
35
|
+
dashedSize?: never;
|
|
36
|
+
lineWidth?: never;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
type LineDashedProps = LineCommonProps & {
|
|
40
|
+
lineStyle: `${LineStyle.DASHED}`;
|
|
41
|
+
spacing?: number;
|
|
42
|
+
dotSize?: never;
|
|
43
|
+
dashedSize?: number;
|
|
44
|
+
lineWidth?: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type LineProps = LineSolidProps | LineDottedProps | LineDashedProps;
|
|
48
|
+
|
|
49
|
+
export const Line = ({
|
|
50
|
+
orientation = LineOrientation.HORIZONTAL,
|
|
51
|
+
className = '',
|
|
52
|
+
style = {},
|
|
53
|
+
color = 'currentColor',
|
|
54
|
+
lineWidth = 1,
|
|
55
|
+
lineStyle = LineStyle.SOLID,
|
|
56
|
+
dotSize = 1,
|
|
57
|
+
dashedSize = 1,
|
|
58
|
+
spacing = 1,
|
|
59
|
+
}: LineProps) => {
|
|
60
|
+
const classNames = useClassNames({
|
|
61
|
+
[orientation]: true,
|
|
62
|
+
[className]: !!className,
|
|
63
|
+
[lineStyle]: true,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<LineComponentStyle
|
|
68
|
+
className={classNames}
|
|
69
|
+
style={style}
|
|
70
|
+
$dashSize={dashedSize}
|
|
71
|
+
$color={color}
|
|
72
|
+
$size={lineStyle === LineStyle.DOTTED ? dotSize : lineWidth}
|
|
73
|
+
$spacing={spacing}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './simple-loader';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './simple-loader';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SimpleLoader } from './simple-loader';
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof SimpleLoader> = {
|
|
6
|
+
title: 'SimpleLoader',
|
|
7
|
+
component: SimpleLoader,
|
|
8
|
+
argTypes: {
|
|
9
|
+
spinDuration: { control: { type: 'range', min: 100, max: 1000, step: 50 } },
|
|
10
|
+
},
|
|
11
|
+
args: {
|
|
12
|
+
spinDuration: 500,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof SimpleLoader>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
args: {},
|
|
21
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export const SimpleLoaderStyle = styled.section`
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
display: grid;
|
|
7
|
+
place-content: center;
|
|
8
|
+
|
|
9
|
+
.simple-loader-spinner {
|
|
10
|
+
animation: spin linear infinite;
|
|
11
|
+
font-size: 3em;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Icon } from '../../icon';
|
|
2
|
+
|
|
3
|
+
import { SimpleLoaderStyle } from './simple-loader.style';
|
|
4
|
+
|
|
5
|
+
type SimpleLoaderProps = {
|
|
6
|
+
spinDuration?: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const SimpleLoader = ({ spinDuration = 500 }: SimpleLoaderProps) => {
|
|
10
|
+
return (
|
|
11
|
+
<SimpleLoaderStyle>
|
|
12
|
+
<Icon name='spinner' className='simple-loader-spinner' style={{ animationDuration: `${spinDuration}ms` }} />
|
|
13
|
+
</SimpleLoaderStyle>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Grid } from '../../../layouts';
|
|
4
|
+
import { Button } from '../../buttons';
|
|
5
|
+
import { IconNames } from '../../icon';
|
|
6
|
+
import { Line } from '../../line';
|
|
7
|
+
import { Typography } from '../../typography';
|
|
8
|
+
|
|
9
|
+
import { ActionModal } from './action-modal';
|
|
10
|
+
|
|
11
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof ActionModal> = {
|
|
14
|
+
title: 'Modals/ActionModal',
|
|
15
|
+
component: ActionModal,
|
|
16
|
+
argTypes: {
|
|
17
|
+
isOpen: { control: false },
|
|
18
|
+
onClose: { control: false },
|
|
19
|
+
actionRequired: { control: 'boolean' },
|
|
20
|
+
icon: { options: [undefined, ...IconNames.toSorted()] },
|
|
21
|
+
noCloseButton: { control: 'boolean' },
|
|
22
|
+
noPadding: { control: 'boolean' },
|
|
23
|
+
className: { control: false },
|
|
24
|
+
style: { control: false },
|
|
25
|
+
lineOnTop: { control: 'boolean' },
|
|
26
|
+
backCard: { control: 'boolean' },
|
|
27
|
+
children: { control: 'text' },
|
|
28
|
+
},
|
|
29
|
+
args: {
|
|
30
|
+
children: 'Action modal content',
|
|
31
|
+
},
|
|
32
|
+
decorators: [
|
|
33
|
+
Story => {
|
|
34
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
<Button onClick={() => setIsOpen(true)}>Open modal</Button>
|
|
39
|
+
<Story isOpen={isOpen} onClose={() => setIsOpen(false)} />
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
render: (args, { isOpen, onClose }) => {
|
|
45
|
+
return <ActionModal {...args} isOpen={isOpen} onClose={onClose} />;
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default meta;
|
|
50
|
+
type Story = StoryObj<typeof ActionModal>;
|
|
51
|
+
|
|
52
|
+
export const Default: Story = {
|
|
53
|
+
args: {},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Confirmation: Story = {
|
|
57
|
+
argTypes: {
|
|
58
|
+
children: { control: false },
|
|
59
|
+
},
|
|
60
|
+
args: {
|
|
61
|
+
backCard: true,
|
|
62
|
+
lineOnTop: true,
|
|
63
|
+
icon: 'user',
|
|
64
|
+
},
|
|
65
|
+
render: (args, { isOpen, onClose }) => {
|
|
66
|
+
return (
|
|
67
|
+
<ActionModal {...args} isOpen={isOpen} onClose={onClose}>
|
|
68
|
+
<Typography variant='header4' align='center' noPadding>
|
|
69
|
+
Action modal
|
|
70
|
+
</Typography>
|
|
71
|
+
<Typography>Are you sure want to execute an action?</Typography>
|
|
72
|
+
<Grid ai='center' gtc='repeat(2, minmax(100px, 1fr))' jc='center' gap='1em' style={{ margin: 'auto' }}>
|
|
73
|
+
<ActionModal.ActionButton
|
|
74
|
+
size='small'
|
|
75
|
+
width='full'
|
|
76
|
+
variant='ghost'
|
|
77
|
+
onClick={() => alert('Action button clicked')}
|
|
78
|
+
>
|
|
79
|
+
No
|
|
80
|
+
</ActionModal.ActionButton>
|
|
81
|
+
<ActionModal.ActionButton
|
|
82
|
+
size='small'
|
|
83
|
+
width='full'
|
|
84
|
+
color='primary'
|
|
85
|
+
onClick={() => alert('Action button clicked')}
|
|
86
|
+
>
|
|
87
|
+
Yes
|
|
88
|
+
</ActionModal.ActionButton>
|
|
89
|
+
</Grid>
|
|
90
|
+
</ActionModal>
|
|
91
|
+
);
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const Classic: Story = {
|
|
96
|
+
argTypes: {
|
|
97
|
+
children: { control: false },
|
|
98
|
+
},
|
|
99
|
+
args: {
|
|
100
|
+
lineOnTop: true,
|
|
101
|
+
noPadding: true,
|
|
102
|
+
},
|
|
103
|
+
render: (args, { isOpen, onClose }) => {
|
|
104
|
+
return (
|
|
105
|
+
<ActionModal {...args} isOpen={isOpen} onClose={onClose}>
|
|
106
|
+
<Typography variant='header4' noPadding style={{ padding: '0 1rem' }}>
|
|
107
|
+
Action modal
|
|
108
|
+
</Typography>
|
|
109
|
+
<Line />
|
|
110
|
+
<Grid gap='1em' style={{ padding: '0 1rem 1rem' }}>
|
|
111
|
+
<Typography>Are you sure want to execute an action?</Typography>
|
|
112
|
+
</Grid>
|
|
113
|
+
<Grid ai='center' gtc='repeat(2, 80px)' jc='end' gap='1em' style={{ padding: '0 1rem 1rem' }}>
|
|
114
|
+
<ActionModal.ActionButton
|
|
115
|
+
size='small'
|
|
116
|
+
width='full'
|
|
117
|
+
variant='ghost'
|
|
118
|
+
onClick={() => alert('Action button clicked')}
|
|
119
|
+
>
|
|
120
|
+
No
|
|
121
|
+
</ActionModal.ActionButton>
|
|
122
|
+
<ActionModal.ActionButton
|
|
123
|
+
size='small'
|
|
124
|
+
width='full'
|
|
125
|
+
color='primary'
|
|
126
|
+
onClick={() => alert('Action button clicked')}
|
|
127
|
+
>
|
|
128
|
+
Yes
|
|
129
|
+
</ActionModal.ActionButton>
|
|
130
|
+
</Grid>
|
|
131
|
+
</ActionModal>
|
|
132
|
+
);
|
|
133
|
+
},
|
|
134
|
+
};
|