polpo 0.1.16 → 0.1.18

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.
Files changed (178) hide show
  1. package/package.json +7 -14
  2. package/.turbo/cache/eslint/.cache_16wwsjl +0 -1
  3. package/.turbo/cache/eslint/.cache_rpznjo +0 -1
  4. package/.turbo/turbo-build$colon$code.log +0 -49
  5. package/.turbo/turbo-build$colon$css.log +0 -2
  6. package/.turbo/turbo-build.log +0 -43
  7. package/.turbo/turbo-lint.log +0 -2
  8. package/eslint.config.js +0 -4
  9. package/postcss.config.js +0 -3
  10. package/src/components/accordion/accordion-item.tsx +0 -123
  11. package/src/components/accordion/accordion.component.tsx +0 -80
  12. package/src/components/accordion/accordion.styles.css +0 -41
  13. package/src/components/accordion/index.ts +0 -2
  14. package/src/components/button/button.component.tsx +0 -50
  15. package/src/components/button/button.styles.css +0 -317
  16. package/src/components/button/index.ts +0 -1
  17. package/src/components/cards/flip-card/flip-card.component.tsx +0 -66
  18. package/src/components/cards/flip-card/flip-card.styles.css +0 -50
  19. package/src/components/cards/flip-card/index.ts +0 -1
  20. package/src/components/cards/hover-card/hover-card.component.tsx +0 -76
  21. package/src/components/cards/hover-card/hover-card.styles.css +0 -13
  22. package/src/components/cards/hover-card/index.ts +0 -1
  23. package/src/components/cards/index.ts +0 -3
  24. package/src/components/cards/slide-card/index.ts +0 -1
  25. package/src/components/cards/slide-card/slide-card.component.tsx +0 -27
  26. package/src/components/component.types.ts +0 -31
  27. package/src/components/cursor/cursor.component.tsx +0 -49
  28. package/src/components/cursor/cursor.styles.css +0 -73
  29. package/src/components/cursor/index.ts +0 -1
  30. package/src/components/form/checkbox/checkbox.component.tsx +0 -95
  31. package/src/components/form/checkbox/checkbox.styles.css +0 -162
  32. package/src/components/form/checkbox/index.ts +0 -1
  33. package/src/components/form/controller/controller.component.tsx +0 -42
  34. package/src/components/form/controller/index.ts +0 -1
  35. package/src/components/form/date-picker/date-picker.component.tsx +0 -66
  36. package/src/components/form/date-picker/index.ts +0 -1
  37. package/src/components/form/field/field.component.tsx +0 -84
  38. package/src/components/form/field/field.styles.css +0 -98
  39. package/src/components/form/field/field.types.ts +0 -34
  40. package/src/components/form/field/index.ts +0 -2
  41. package/src/components/form/form.types.ts +0 -37
  42. package/src/components/form/index.ts +0 -14
  43. package/src/components/form/input/index.ts +0 -1
  44. package/src/components/form/input/input.component.tsx +0 -75
  45. package/src/components/form/input-color/index.ts +0 -1
  46. package/src/components/form/input-color/input-color.component.tsx +0 -170
  47. package/src/components/form/input-color/input-color.styles.css +0 -92
  48. package/src/components/form/input-file/index.ts +0 -1
  49. package/src/components/form/input-file/input-file.component.tsx +0 -221
  50. package/src/components/form/input-file/input-file.styles.css +0 -143
  51. package/src/components/form/input-number/index.ts +0 -1
  52. package/src/components/form/input-number/input-number.component.tsx +0 -144
  53. package/src/components/form/input-password/index.ts +0 -1
  54. package/src/components/form/input-password/input-password.component.tsx +0 -77
  55. package/src/components/form/radio/index.ts +0 -1
  56. package/src/components/form/radio/radio.component.tsx +0 -92
  57. package/src/components/form/radio/radio.styles.css +0 -117
  58. package/src/components/form/select/index.ts +0 -1
  59. package/src/components/form/select/option.tsx +0 -101
  60. package/src/components/form/select/options.tsx +0 -165
  61. package/src/components/form/select/select.component.tsx +0 -317
  62. package/src/components/form/select/select.styles.css +0 -115
  63. package/src/components/form/select/select.types.ts +0 -97
  64. package/src/components/form/slider/index.ts +0 -1
  65. package/src/components/form/slider/slider.component.tsx +0 -117
  66. package/src/components/form/slider/slider.styles.css +0 -94
  67. package/src/components/form/switch/index.ts +0 -1
  68. package/src/components/form/switch/switch.component.tsx +0 -166
  69. package/src/components/form/switch/switch.styles.css +0 -165
  70. package/src/components/form/textarea/index.ts +0 -1
  71. package/src/components/form/textarea/textarea.component.tsx +0 -80
  72. package/src/components/form/textarea/textarea.styles.css +0 -7
  73. package/src/components/image/image.tsx +0 -7
  74. package/src/components/image/index.ts +0 -1
  75. package/src/components/index.ts +0 -15
  76. package/src/components/infinity-scroll/index.ts +0 -1
  77. package/src/components/infinity-scroll/infinity-scroll.component.tsx +0 -51
  78. package/src/components/infinity-scroll/infinity-scroll.styles.css +0 -25
  79. package/src/components/line/index.ts +0 -1
  80. package/src/components/line/line.component.tsx +0 -77
  81. package/src/components/line/line.styles.css +0 -61
  82. package/src/components/modals/action-modal/action-modal.component.tsx +0 -150
  83. package/src/components/modals/action-modal/action-modal.styles.css +0 -115
  84. package/src/components/modals/action-modal/index.ts +0 -1
  85. package/src/components/modals/aside-modal/aside-modal.component.tsx +0 -63
  86. package/src/components/modals/aside-modal/aside-modal.styles.css +0 -86
  87. package/src/components/modals/aside-modal/index.ts +0 -1
  88. package/src/components/modals/confirmation-modal/confirmation-modal.component.tsx +0 -43
  89. package/src/components/modals/confirmation-modal/confirmation-modal.styles.css +0 -17
  90. package/src/components/modals/confirmation-modal/index.ts +0 -1
  91. package/src/components/modals/index.ts +0 -6
  92. package/src/components/modals/menu/index.ts +0 -1
  93. package/src/components/modals/menu/menu.component.tsx +0 -194
  94. package/src/components/modals/menu/menu.styles.css +0 -101
  95. package/src/components/modals/modal/index.ts +0 -2
  96. package/src/components/modals/modal/modal.backdrop.tsx +0 -67
  97. package/src/components/modals/modal/modal.component.tsx +0 -104
  98. package/src/components/modals/modal/modal.styles.css +0 -70
  99. package/src/components/modals/portal/index.ts +0 -1
  100. package/src/components/modals/portal/portal.component.tsx +0 -19
  101. package/src/components/ripple/index.ts +0 -1
  102. package/src/components/ripple/ripple.component.tsx +0 -70
  103. package/src/components/ripple/ripple.styles.css +0 -33
  104. package/src/components/smart-table/index.ts +0 -2
  105. package/src/components/smart-table/smart-table.column.tsx +0 -62
  106. package/src/components/smart-table/smart-table.component.tsx +0 -116
  107. package/src/components/smart-table/smart-table.helpers.tsx +0 -58
  108. package/src/components/smart-table/smart-table.hooks.ts +0 -27
  109. package/src/components/smart-table/smart-table.row.tsx +0 -28
  110. package/src/components/smart-table/smart-table.styles.css +0 -102
  111. package/src/components/smart-table/smart-table.types.ts +0 -42
  112. package/src/components/tabs/index.ts +0 -1
  113. package/src/components/tabs/tabs-list.tsx +0 -120
  114. package/src/components/tabs/tabs.styles.css +0 -164
  115. package/src/components/tabs/tabs.tsx +0 -119
  116. package/src/components/tag/index.ts +0 -1
  117. package/src/components/tag/tag.component.tsx +0 -34
  118. package/src/components/tag/tag.styles.css +0 -50
  119. package/src/components/tooltips/click-to-copy/click-to-copy.component.tsx +0 -41
  120. package/src/components/tooltips/click-to-copy/index.ts +0 -1
  121. package/src/components/tooltips/index.ts +0 -2
  122. package/src/components/tooltips/tooltip/index.ts +0 -1
  123. package/src/components/tooltips/tooltip/tooltip.component.tsx +0 -64
  124. package/src/components/tooltips/tooltip/tooltip.styles.css +0 -91
  125. package/src/components/typography/index.ts +0 -1
  126. package/src/components/typography/typography.component.tsx +0 -81
  127. package/src/components/typography/typography.constants.ts +0 -53
  128. package/src/components/typography/typography.styles.css +0 -122
  129. package/src/helpers/cn.ts +0 -6
  130. package/src/helpers/format-bytes.ts +0 -11
  131. package/src/helpers/format-dates.ts +0 -47
  132. package/src/helpers/get-modal-position-relative-to-screen.ts +0 -86
  133. package/src/helpers/get-modal-position.ts +0 -211
  134. package/src/helpers/index.ts +0 -6
  135. package/src/helpers/text/index.ts +0 -1
  136. package/src/helpers/text/to-capitalize.ts +0 -17
  137. package/src/hooks/index.ts +0 -30
  138. package/src/hooks/use-async.ts +0 -88
  139. package/src/hooks/use-classnames.ts +0 -13
  140. package/src/hooks/use-click-outside.ts +0 -32
  141. package/src/hooks/use-constant.ts +0 -3
  142. package/src/hooks/use-cookie.ts +0 -124
  143. package/src/hooks/use-debounce-state.ts +0 -13
  144. package/src/hooks/use-debounce.ts +0 -15
  145. package/src/hooks/use-dimensions.ts +0 -19
  146. package/src/hooks/use-dom-container.ts +0 -35
  147. package/src/hooks/use-event-listener.ts +0 -71
  148. package/src/hooks/use-file-reader.ts +0 -69
  149. package/src/hooks/use-geolocation.ts +0 -63
  150. package/src/hooks/use-hover.ts +0 -17
  151. package/src/hooks/use-in-view.ts +0 -18
  152. package/src/hooks/use-input-handlers.ts +0 -52
  153. package/src/hooks/use-intersection-observer.ts +0 -19
  154. package/src/hooks/use-media-query.ts +0 -25
  155. package/src/hooks/use-modal-in-container.ts +0 -85
  156. package/src/hooks/use-modal-transition.ts +0 -64
  157. package/src/hooks/use-modal.ts +0 -21
  158. package/src/hooks/use-mouse-position.ts +0 -64
  159. package/src/hooks/use-online-status.ts +0 -12
  160. package/src/hooks/use-render-count.ts +0 -11
  161. package/src/hooks/use-resize-observer.ts +0 -18
  162. package/src/hooks/use-safe-dispatch.ts +0 -22
  163. package/src/hooks/use-scroll.ts +0 -31
  164. package/src/hooks/use-state-history.ts +0 -22
  165. package/src/hooks/use-toggle-values.ts +0 -14
  166. package/src/hooks/use-toggle.ts +0 -11
  167. package/src/hooks/use-viewport.ts +0 -38
  168. package/src/index.ts +0 -5
  169. package/src/layouts/flex/flex.component.tsx +0 -75
  170. package/src/layouts/flex/index.ts +0 -1
  171. package/src/layouts/grid/grid.component.tsx +0 -89
  172. package/src/layouts/grid/grid.styles.css +0 -5
  173. package/src/layouts/grid/index.ts +0 -1
  174. package/src/layouts/index.ts +0 -2
  175. package/src/types/generics.ts +0 -68
  176. package/src/types/index.ts +0 -1
  177. package/tsconfig.json +0 -10
  178. package/tsup.config.cjs +0 -36
@@ -1,49 +0,0 @@
1
-
2
- $ pnpm clean && tsup
3
- $ rm -rf ./dist
4
- CLI Building entry: {"components":"./src/components/index.ts","hooks":"./src/hooks/index.ts","layouts":"./src/layouts/index.ts","types":"./src/types/index.ts","helpers":"./src/helpers/index.ts"}
5
- CLI Using tsconfig: tsconfig.json
6
- CLI tsup v8.5.1
7
- CLI Using tsup config: /Users/juanmsl/Code/personal/polpo-monorepo/packages/polpo/tsup.config.cjs
8
- CLI Target: node24
9
- CLI Cleaning output folder
10
- CJS Build start
11
- ESM Build start
12
- ESM dist/hooks.js 28.60 KB
13
- ESM dist/components.js 109.33 KB
14
- ESM dist/types.js 47.00 B
15
- ESM dist/layouts.js 2.47 KB
16
- ESM dist/helpers.js 8.49 KB
17
- ESM dist/hooks.js.map 58.95 KB
18
- ESM dist/types.js.map 71.00 B
19
- ESM dist/layouts.js.map 7.06 KB
20
- ESM dist/helpers.js.map 15.46 KB
21
- ESM dist/components.js.map 213.96 KB
22
- ESM ⚡️ Build success in 67ms
23
- CJS dist/layouts.cjs 3.51 KB
24
- CJS dist/hooks.cjs 31.73 KB
25
- CJS dist/helpers.cjs 9.94 KB
26
- CJS dist/types.cjs 812.00 B
27
- CJS dist/components.cjs 118.79 KB
28
- CJS dist/hooks.cjs.map 59.32 KB
29
- CJS dist/types.cjs.map 152.00 B
30
- CJS dist/layouts.cjs.map 7.15 KB
31
- CJS dist/helpers.cjs.map 15.76 KB
32
- CJS dist/components.cjs.map 211.08 KB
33
- CJS ⚡️ Build success in 68ms
34
- DTS Build start
35
- DTS ⚡️ Build success in 5444ms
36
- DTS dist/layouts.d.cts 149.67 KB
37
- DTS dist/helpers.d.cts 1.14 KB
38
- DTS dist/hooks.d.cts 6.69 KB
39
- DTS dist/components.d.cts 114.15 KB
40
- DTS dist/types.d.cts 228.00 B
41
- DTS dist/get-modal-position-C5jQsaGx.d.cts 1.71 KB
42
- DTS dist/use-modal-transition-C7DzbnY5.d.cts 1.16 KB
43
- DTS dist/layouts.d.ts 149.67 KB
44
- DTS dist/helpers.d.ts 1.14 KB
45
- DTS dist/hooks.d.ts 6.69 KB
46
- DTS dist/components.d.ts 114.15 KB
47
- DTS dist/types.d.ts 228.00 B
48
- DTS dist/get-modal-position-C5jQsaGx.d.ts 1.71 KB
49
- DTS dist/use-modal-transition-C0lyjvkD.d.ts 1.16 KB
@@ -1,2 +0,0 @@
1
-
2
- $ postcss "src/**/*.css" --base src -d dist
@@ -1,43 +0,0 @@
1
-
2
- $ pnpm clean && tsup
3
- $ rm -rf ./dist
4
- CLI Building entry: {"components":"./src/components/index.ts","hooks":"./src/hooks/index.ts","layouts":"./src/layouts/index.ts","types":"./src/types/index.ts","helpers":"./src/helpers/index.ts"}
5
- CLI Using tsconfig: tsconfig.json
6
- CLI tsup v8.5.1
7
- CLI Using tsup config: /Users/juanmsl/Code/personal/polpo-monorepo/packages/polpo/tsup.config.cjs
8
- CLI Target: node24
9
- CLI Cleaning output folder
10
- CJS Build start
11
- ESM Build start
12
- DTS Build start
13
- CJS dist/components.css 42.06 KB
14
- CJS dist/layouts.cjs 1.84 KB
15
- CJS dist/layouts.css 87.00 B
16
- CJS dist/components.cjs 52.90 KB
17
- CJS dist/hooks.cjs 13.36 KB
18
- CJS dist/helpers.cjs 4.47 KB
19
- CJS dist/types.cjs 411.00 B
20
- CJS ⚡️ Build success in 300ms
21
- ESM dist/components.css 42.06 KB
22
- ESM dist/components.js 50.63 KB
23
- ESM dist/layouts.js 1.37 KB
24
- ESM dist/layouts.css 87.00 B
25
- ESM dist/helpers.js 3.82 KB
26
- ESM dist/types.js 14.00 B
27
- ESM dist/hooks.js 12.17 KB
28
- ESM ⚡️ Build success in 301ms
29
- DTS ⚡️ Build success in 5081ms
30
- DTS dist/layouts.d.cts 149.67 KB
31
- DTS dist/helpers.d.cts 1.14 KB
32
- DTS dist/hooks.d.cts 6.69 KB
33
- DTS dist/components.d.cts 114.15 KB
34
- DTS dist/types.d.cts 228.00 B
35
- DTS dist/get-modal-position-C5jQsaGx.d.cts 1.71 KB
36
- DTS dist/use-modal-transition-C7DzbnY5.d.cts 1.16 KB
37
- DTS dist/layouts.d.ts 149.67 KB
38
- DTS dist/helpers.d.ts 1.14 KB
39
- DTS dist/hooks.d.ts 6.69 KB
40
- DTS dist/components.d.ts 114.15 KB
41
- DTS dist/types.d.ts 228.00 B
42
- DTS dist/get-modal-position-C5jQsaGx.d.ts 1.71 KB
43
- DTS dist/use-modal-transition-C0lyjvkD.d.ts 1.16 KB
@@ -1,2 +0,0 @@
1
-
2
- $ eslint src --max-warnings 0 --cache --cache-location .turbo/cache/eslint/ --fix
package/eslint.config.js DELETED
@@ -1,4 +0,0 @@
1
- import EslintConfig from 'polpo-eslint-config/react';
2
- import { defineConfig } from 'eslint/config';
3
-
4
- export default defineConfig([...EslintConfig]);
package/postcss.config.js DELETED
@@ -1,3 +0,0 @@
1
- import { postcssConfig } from 'polpo-tailwind-config/postcss';
2
-
3
- export default postcssConfig;
@@ -1,123 +0,0 @@
1
- import React, { useMemo } from 'react';
2
- import { IconType } from 'react-icons';
3
- import { FaCaretLeft } from 'react-icons/fa';
4
-
5
- import { useClassNames } from '../../hooks';
6
- import { SlideCard } from '../cards';
7
- import { Typography } from '../typography';
8
-
9
- import { useAccordionItem } from './accordion.component';
10
-
11
- type NodeFunction = (isOpen: boolean) => React.ReactNode;
12
-
13
- type ContentType = React.ReactNode | NodeFunction;
14
-
15
- type AccordionItemCommonProps = {
16
- icon?: IconType;
17
- children: React.ReactNode;
18
- startContent?: ContentType;
19
- endContent?: ContentType;
20
- className?: string;
21
- style?: React.CSSProperties;
22
- classNames?: {
23
- header?: string;
24
- headerContent?: string;
25
- title?: string;
26
- subtitle?: string;
27
- toggleIcon?: string;
28
- body?: string;
29
- };
30
- };
31
-
32
- type AccordionItemTitleProps = AccordionItemCommonProps & {
33
- title?: ContentType;
34
- subtitle?: ContentType;
35
- content?: never;
36
- };
37
-
38
- type AccordionItemContentProps = AccordionItemCommonProps & {
39
- title?: never;
40
- subtitle?: never;
41
- content?: ContentType;
42
- };
43
-
44
- type AccordionItemProps = AccordionItemTitleProps | AccordionItemContentProps;
45
-
46
- const getContent = (content: ContentType | undefined, isOpen: boolean): React.ReactNode | undefined => {
47
- if (typeof content === 'function') {
48
- return content(isOpen);
49
- }
50
-
51
- return content;
52
- };
53
-
54
- export const AccordionItem: React.FC<AccordionItemProps> = ({
55
- title,
56
- subtitle,
57
- children,
58
- icon: Icon = FaCaretLeft,
59
- startContent,
60
- content,
61
- endContent,
62
- classNames = {},
63
- className = '',
64
- style = {},
65
- }: AccordionItemProps) => {
66
- const id = useMemo(() => crypto.randomUUID(), []);
67
- const [isOpen, toggle] = useAccordionItem(id);
68
- const headerClassName = useClassNames({
69
- 'accordion-header': true,
70
- 'has-start-content': !!startContent,
71
- [classNames?.header ?? '']: !!classNames?.header,
72
- 'is-open': isOpen,
73
- });
74
-
75
- const headerContentClassName = useClassNames({
76
- 'accordion-header-content': true,
77
- [classNames?.headerContent ?? '']: !!classNames?.headerContent,
78
- });
79
-
80
- const toggleIconClassName = useClassNames({
81
- 'accordion-toggle-icon': true,
82
- isOpen: isOpen,
83
- [classNames?.toggleIcon ?? '']: !!classNames?.toggleIcon,
84
- });
85
-
86
- const bodyContentClassName = useClassNames({
87
- 'accordion-body': true,
88
- [classNames?.body ?? '']: !!classNames?.body,
89
- });
90
-
91
- const titleContent = getContent(title, isOpen);
92
- const subtitleContent = getContent(subtitle, isOpen);
93
- const headerStart = getContent(startContent, isOpen);
94
- const headerMiddle = getContent(content, isOpen) ?? (
95
- <section className={headerContentClassName}>
96
- <Typography className={classNames?.title} variant='body' noPadding weight='bold'>
97
- {titleContent}
98
- </Typography>
99
- <Typography className={classNames?.subtitle} variant='label' noPadding weight='light'>
100
- {subtitleContent}
101
- </Typography>
102
- </section>
103
- );
104
- const headerEnd = getContent(endContent, isOpen) ?? <Icon className={toggleIconClassName} />;
105
-
106
- const accordionItemClassName = useClassNames({
107
- 'accordion-item': true,
108
- [className]: Boolean(className),
109
- });
110
-
111
- return (
112
- <section className={accordionItemClassName} style={style}>
113
- <section className={headerClassName} onClick={toggle}>
114
- {headerStart}
115
- {headerMiddle}
116
- {headerEnd}
117
- </section>
118
- <SlideCard isOpen={isOpen}>
119
- <section className={bodyContentClassName}>{children}</section>
120
- </SlideCard>
121
- </section>
122
- );
123
- };
@@ -1,80 +0,0 @@
1
- import React, { createContext, useCallback, useContext, useMemo, useState } from 'react';
2
-
3
- import { useClassNames } from '../../hooks';
4
- import { Line } from '../line';
5
-
6
- import './accordion.styles.css';
7
-
8
- type AccordionContextState = {
9
- toggleItem: (id: string) => void;
10
- openedItems: Array<string>;
11
- };
12
-
13
- const AccordionContext = createContext<AccordionContextState | null>(null);
14
-
15
- export const useAccordionItem = (id: string): [boolean, () => void] => {
16
- const context = useContext(AccordionContext);
17
-
18
- if (!context) {
19
- throw new Error('You cant use this component out off an Accordion component');
20
- }
21
-
22
- const { toggleItem, openedItems } = context;
23
-
24
- const toggle = () => toggleItem(id);
25
-
26
- return [openedItems.includes(id), toggle];
27
- };
28
-
29
- type AccordionProps = {
30
- children: React.ReactNode;
31
- className?: string;
32
- style?: React.CSSProperties;
33
- noSeparators?: boolean;
34
- multiple?: boolean;
35
- defaultOpened?: Array<string> | string;
36
- };
37
-
38
- export const Accordion = ({
39
- children,
40
- className = '',
41
- noSeparators,
42
- multiple,
43
- style = {},
44
- defaultOpened = [],
45
- }: AccordionProps) => {
46
- const [openedItems, setOpenedItems] = useState<{ [index: string]: boolean }>(() => {
47
- return (Array.isArray(defaultOpened) ? defaultOpened : [defaultOpened]).reduce((acc, id) => {
48
- return typeof id === 'string' ? { ...acc, [id]: true } : acc;
49
- }, {});
50
- });
51
-
52
- const toggleItem = useCallback(
53
- (id: string) => {
54
- setOpenedItems(prev => ({ ...(multiple ? prev : {}), [id]: !prev[id] }));
55
- },
56
- [multiple],
57
- );
58
-
59
- const openedItemsIDs = useMemo(() => Object.keys(openedItems).filter(id => openedItems[id]), [openedItems]);
60
-
61
- const accordionClassName = useClassNames({
62
- accordion: true,
63
- [className]: Boolean(className),
64
- });
65
-
66
- return (
67
- <AccordionContext.Provider
68
- value={{
69
- toggleItem,
70
- openedItems: openedItemsIDs,
71
- }}
72
- >
73
- <section className={accordionClassName} style={style}>
74
- {(Array.isArray(children) ? children : [children]).flatMap((child, key) => {
75
- return key === 0 ? child : [noSeparators ? null : <Line orientation='horizontal' key={`${key}.5`} />, child];
76
- })}
77
- </section>
78
- </AccordionContext.Provider>
79
- );
80
- };
@@ -1,41 +0,0 @@
1
- @reference "polpo-tailwind-config/styles";
2
-
3
- .accordion {
4
- display: grid;
5
- }
6
-
7
- .accordion-item {
8
- display: grid;
9
- position: relative;
10
-
11
- .accordion-header {
12
- display: grid;
13
- grid-template-columns: 1fr auto;
14
- align-items: center;
15
- gap: 20px;
16
- cursor: pointer;
17
- position: sticky;
18
- top: 0;
19
- padding: 20px 0;
20
-
21
- &.has-start-content {
22
- grid-template-columns: auto 1fr auto;
23
- }
24
- }
25
-
26
- .accordion-header-content {
27
- display: grid;
28
- }
29
-
30
- .accordion-toggle-icon {
31
- transition: all 300ms ease;
32
-
33
- &.isOpen {
34
- transform: rotate(-90deg);
35
- }
36
- }
37
-
38
- .accordion-body {
39
- padding: 10px 0 20px;
40
- }
41
- }
@@ -1,2 +0,0 @@
1
- export * from './accordion.component';
2
- export * from './accordion-item';
@@ -1,50 +0,0 @@
1
- import type { ButtonHTMLAttributes } from 'react';
2
-
3
- import { cn } from '../../helpers';
4
- import { ColorTypes, RadiusTypes, SizeTypes, VariantTypes } from '../component.types';
5
- import { Ripple } from '../ripple';
6
-
7
- import './button.styles.css';
8
-
9
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
10
- children: React.ReactNode;
11
- color?: `${ColorTypes}`;
12
- variant?: `${VariantTypes}`;
13
- radius?: `${RadiusTypes}`;
14
- size?: `${SizeTypes}`;
15
- noWrap?: boolean;
16
- ref?: React.Ref<HTMLButtonElement>;
17
- forIcon?: boolean;
18
- isLoading?: boolean;
19
- }
20
-
21
- export const Button = ({
22
- children,
23
- color = ColorTypes.DEFAULT,
24
- variant = VariantTypes.SOLID,
25
- radius = RadiusTypes.MEDIUM,
26
- size = SizeTypes.REGULAR,
27
- noWrap = false,
28
- forIcon = false,
29
- className = '',
30
- ...props
31
- }: ButtonProps) => {
32
- return (
33
- <button
34
- {...props}
35
- className={cn(
36
- 'button',
37
- color,
38
- variant,
39
- radius && `radius-${radius}`,
40
- size && `size-${size}`,
41
- noWrap && 'no-wrap',
42
- forIcon && 'icon',
43
- className,
44
- )}
45
- >
46
- {children}
47
- <Ripple />
48
- </button>
49
- );
50
- };