@udixio/ui-react 2.10.12 → 2.10.14

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 (179) hide show
  1. package/dist/index.cjs +3 -3
  2. package/dist/index.js +2696 -2710
  3. package/dist/lib/effects/ThemeProvider.d.ts.map +1 -1
  4. package/dist/theme.worker.js +6633 -0
  5. package/package.json +4 -1
  6. package/.eslintrc.mjs +0 -22
  7. package/.storybook/main.ts +0 -20
  8. package/.storybook/preview.ts +0 -1
  9. package/CHANGELOG.md +0 -1130
  10. package/dist/scrollDriven-AP2yWhzi.js +0 -121
  11. package/postcss.config.mjs +0 -5
  12. package/src/index.css +0 -4
  13. package/src/index.ts +0 -1
  14. package/src/lib/components/AnchorPositioner.tsx +0 -185
  15. package/src/lib/components/Button.tsx +0 -208
  16. package/src/lib/components/Card.tsx +0 -47
  17. package/src/lib/components/Carousel.tsx +0 -437
  18. package/src/lib/components/CarouselItem.tsx +0 -61
  19. package/src/lib/components/Checkbox.tsx +0 -120
  20. package/src/lib/components/Chip.tsx +0 -341
  21. package/src/lib/components/Chips.tsx +0 -331
  22. package/src/lib/components/ContextMenu.tsx +0 -109
  23. package/src/lib/components/DatePicker.tsx +0 -432
  24. package/src/lib/components/Divider.tsx +0 -20
  25. package/src/lib/components/Fab.tsx +0 -127
  26. package/src/lib/components/FabMenu.tsx +0 -239
  27. package/src/lib/components/IconButton.tsx +0 -146
  28. package/src/lib/components/Menu.tsx +0 -88
  29. package/src/lib/components/MenuGroup.tsx +0 -34
  30. package/src/lib/components/MenuHeadline.tsx +0 -9
  31. package/src/lib/components/MenuItem.tsx +0 -215
  32. package/src/lib/components/NavigationRail.tsx +0 -186
  33. package/src/lib/components/NavigationRailItem.tsx +0 -227
  34. package/src/lib/components/ProgressIndicator.tsx +0 -214
  35. package/src/lib/components/SideSheet.tsx +0 -135
  36. package/src/lib/components/Slider.tsx +0 -374
  37. package/src/lib/components/Snackbar.tsx +0 -77
  38. package/src/lib/components/Switch.tsx +0 -107
  39. package/src/lib/components/Tab.tsx +0 -123
  40. package/src/lib/components/TabGroup.tsx +0 -66
  41. package/src/lib/components/TabGroupContext.tsx +0 -16
  42. package/src/lib/components/TabPanel.tsx +0 -27
  43. package/src/lib/components/TabPanels.tsx +0 -76
  44. package/src/lib/components/Tabs.tsx +0 -105
  45. package/src/lib/components/TextField.tsx +0 -586
  46. package/src/lib/components/Tooltip.tsx +0 -217
  47. package/src/lib/components/index.ts +0 -34
  48. package/src/lib/config/config.interface.ts +0 -9
  49. package/src/lib/config/define-config.ts +0 -16
  50. package/src/lib/config/index.ts +0 -2
  51. package/src/lib/effects/AnimateOnScroll.ts +0 -391
  52. package/src/lib/effects/State.tsx +0 -90
  53. package/src/lib/effects/SyncedFixedWrapper.tsx +0 -62
  54. package/src/lib/effects/ThemeProvider.tsx +0 -172
  55. package/src/lib/effects/block-scroll.effect.tsx +0 -313
  56. package/src/lib/effects/custom-scroll/custom-scroll.effect.tsx +0 -407
  57. package/src/lib/effects/custom-scroll/custom-scroll.interface.ts +0 -29
  58. package/src/lib/effects/custom-scroll/custom-scroll.style.ts +0 -32
  59. package/src/lib/effects/custom-scroll/index.ts +0 -3
  60. package/src/lib/effects/index.ts +0 -7
  61. package/src/lib/effects/ripple/RippleEffect.tsx +0 -116
  62. package/src/lib/effects/ripple/index.tsx +0 -1
  63. package/src/lib/effects/scrollDriven.ts +0 -239
  64. package/src/lib/effects/smooth-scroll.effect.tsx +0 -112
  65. package/src/lib/effects/theme.worker.ts +0 -97
  66. package/src/lib/hooks/index.ts +0 -10
  67. package/src/lib/hooks/useTooltipTrigger.ts +0 -270
  68. package/src/lib/icon/icon.tsx +0 -125
  69. package/src/lib/icon/index.ts +0 -1
  70. package/src/lib/index.ts +0 -8
  71. package/src/lib/interfaces/button.interface.ts +0 -65
  72. package/src/lib/interfaces/card.interface.ts +0 -11
  73. package/src/lib/interfaces/carousel-item.interface.ts +0 -12
  74. package/src/lib/interfaces/carousel.interface.ts +0 -41
  75. package/src/lib/interfaces/checkbox.interface.ts +0 -39
  76. package/src/lib/interfaces/chip.interface.ts +0 -97
  77. package/src/lib/interfaces/chips.interface.ts +0 -37
  78. package/src/lib/interfaces/date-picker.interface.ts +0 -79
  79. package/src/lib/interfaces/divider.interface.ts +0 -7
  80. package/src/lib/interfaces/fab-menu.interface.ts +0 -12
  81. package/src/lib/interfaces/fab.interface.ts +0 -27
  82. package/src/lib/interfaces/icon-button.interface.ts +0 -38
  83. package/src/lib/interfaces/index.ts +0 -26
  84. package/src/lib/interfaces/menu-group.interface.ts +0 -13
  85. package/src/lib/interfaces/menu-item.interface.ts +0 -29
  86. package/src/lib/interfaces/menu.interface.ts +0 -19
  87. package/src/lib/interfaces/navigation-rail-item.interface.ts +0 -39
  88. package/src/lib/interfaces/navigation-rail.interface.ts +0 -39
  89. package/src/lib/interfaces/progress-indicator.interface.ts +0 -41
  90. package/src/lib/interfaces/side-sheet.interface.tsx +0 -28
  91. package/src/lib/interfaces/slider.interface.ts +0 -27
  92. package/src/lib/interfaces/snackbar.interface.ts +0 -13
  93. package/src/lib/interfaces/switch.interface.ts +0 -14
  94. package/src/lib/interfaces/tab-group.interface.ts +0 -13
  95. package/src/lib/interfaces/tab-panels.interface.ts +0 -21
  96. package/src/lib/interfaces/tab.interface.ts +0 -31
  97. package/src/lib/interfaces/tabs.interface.ts +0 -22
  98. package/src/lib/interfaces/text-field.interface.ts +0 -61
  99. package/src/lib/interfaces/tooltip.interface.ts +0 -61
  100. package/src/lib/styles/button.style.ts +0 -136
  101. package/src/lib/styles/card.style.ts +0 -29
  102. package/src/lib/styles/carousel-item.style.ts +0 -24
  103. package/src/lib/styles/carousel.style.ts +0 -22
  104. package/src/lib/styles/checkbox.style.ts +0 -64
  105. package/src/lib/styles/chip.style.ts +0 -62
  106. package/src/lib/styles/chips.style.ts +0 -20
  107. package/src/lib/styles/date-picker.style.ts +0 -43
  108. package/src/lib/styles/divider.style.ts +0 -31
  109. package/src/lib/styles/fab-menu.style.ts +0 -29
  110. package/src/lib/styles/fab.style.ts +0 -49
  111. package/src/lib/styles/icon-button.style.ts +0 -168
  112. package/src/lib/styles/index.ts +0 -25
  113. package/src/lib/styles/menu-group.style.ts +0 -34
  114. package/src/lib/styles/menu-headline.style.ts +0 -20
  115. package/src/lib/styles/menu-item.style.ts +0 -45
  116. package/src/lib/styles/menu.style.ts +0 -32
  117. package/src/lib/styles/navigation-rail-item.style.ts +0 -56
  118. package/src/lib/styles/navigation-rail.style.ts +0 -36
  119. package/src/lib/styles/progress-indicator.style.ts +0 -72
  120. package/src/lib/styles/side-sheet.style.ts +0 -45
  121. package/src/lib/styles/slider.style.ts +0 -41
  122. package/src/lib/styles/snackbar.style.ts +0 -26
  123. package/src/lib/styles/switch.style.ts +0 -67
  124. package/src/lib/styles/tab-panels.style.ts +0 -35
  125. package/src/lib/styles/tab.style.ts +0 -78
  126. package/src/lib/styles/tabs.style.ts +0 -22
  127. package/src/lib/styles/text-field.style.ts +0 -115
  128. package/src/lib/styles/tooltip.style.ts +0 -48
  129. package/src/lib/utils/component-helper.ts +0 -134
  130. package/src/lib/utils/component.ts +0 -34
  131. package/src/lib/utils/index.ts +0 -7
  132. package/src/lib/utils/string.ts +0 -9
  133. package/src/lib/utils/styles/classnames.ts +0 -49
  134. package/src/lib/utils/styles/get-classname.ts +0 -96
  135. package/src/lib/utils/styles/index.ts +0 -4
  136. package/src/lib/utils/styles/use-classnames.ts +0 -25
  137. package/src/stories/action/button.stories.tsx +0 -86
  138. package/src/stories/action/fab.stories.tsx +0 -54
  139. package/src/stories/action/icon-button.stories.tsx +0 -134
  140. package/src/stories/assets/accessibility.png +0 -0
  141. package/src/stories/assets/accessibility.svg +0 -5
  142. package/src/stories/assets/addon-library.png +0 -0
  143. package/src/stories/assets/assets.png +0 -0
  144. package/src/stories/assets/context.png +0 -0
  145. package/src/stories/assets/discord.svg +0 -15
  146. package/src/stories/assets/docs.png +0 -0
  147. package/src/stories/assets/figma-plugin.png +0 -0
  148. package/src/stories/assets/github.svg +0 -3
  149. package/src/stories/assets/share.png +0 -0
  150. package/src/stories/assets/styling.png +0 -0
  151. package/src/stories/assets/testing.png +0 -0
  152. package/src/stories/assets/theming.png +0 -0
  153. package/src/stories/assets/tutorials.svg +0 -12
  154. package/src/stories/assets/youtube.svg +0 -4
  155. package/src/stories/communication/ProgressIndicator.stories.tsx +0 -57
  156. package/src/stories/communication/SnackBar.stories.tsx +0 -32
  157. package/src/stories/communication/tool-tip.stories.tsx +0 -133
  158. package/src/stories/containment/card.stories.tsx +0 -42
  159. package/src/stories/containment/carousel.stories.tsx +0 -65
  160. package/src/stories/containment/divider.stories.tsx +0 -35
  161. package/src/stories/containment/slide-sheet.stories.tsx +0 -45
  162. package/src/stories/effect/smooth-scroll.stories.tsx +0 -54
  163. package/src/stories/navigation/navigation-rail/navigation-rail-item.stories.tsx +0 -65
  164. package/src/stories/navigation/navigation-rail/navigation-rail.stories.tsx +0 -122
  165. package/src/stories/navigation/tabs/tab.stories.tsx +0 -57
  166. package/src/stories/navigation/tabs/tabs.stories.tsx +0 -102
  167. package/src/stories/selection/slider.stories.tsx +0 -85
  168. package/src/stories/selection/switch.stories.tsx +0 -46
  169. package/src/stories/text-inputs/text-field.stories.tsx +0 -135
  170. package/src/tests/Button.spec.tsx +0 -67
  171. package/src/tests/useClassNames.spec.tsx +0 -82
  172. package/src/udixio.css +0 -120
  173. package/theme.config.ts +0 -7
  174. package/tsconfig.json +0 -16
  175. package/tsconfig.lib.json +0 -51
  176. package/tsconfig.spec.json +0 -37
  177. package/tsconfig.storybook.json +0 -38
  178. package/vite.config.ts +0 -82
  179. /package/dist/{scrollDriven-DWAu7CR0.cjs → scrollDriven.js} +0 -0
@@ -1,61 +0,0 @@
1
- import { ReactProps } from '../utils';
2
- import { ButtonInterface } from './button.interface';
3
- import { ReactNode, RefObject } from 'react';
4
- import { Transition } from 'motion';
5
-
6
- type Trigger = 'hover' | 'click' | 'focus' | null;
7
-
8
- export type ToolTipInterface<T extends HTMLElement = any> = {
9
- type: 'div';
10
- props: {
11
- variant?: 'plain' | 'rich';
12
- title?: string;
13
- /** Supporting text for the tooltip. Optional when using `content` prop. */
14
- text?: string;
15
- /** Custom content slot that replaces title/text/buttons when provided */
16
- content?: ReactNode;
17
- buttons?: ReactProps<ButtonInterface> | ReactProps<ButtonInterface>[];
18
- position?:
19
- | 'top'
20
- | 'bottom'
21
- | 'left'
22
- | 'right'
23
- | 'top-left'
24
- | 'top-right'
25
- | 'bottom-left'
26
- | 'bottom-right';
27
- trigger?: Trigger | Trigger[];
28
- transition?: Transition;
29
- /** Delay in milliseconds before showing the tooltip. Default: 400ms */
30
- openDelay?: number;
31
- /** Delay in milliseconds before hiding the tooltip. Default: 150ms */
32
- closeDelay?: number;
33
- /** Controlled mode: explicitly control whether the tooltip is open */
34
- isOpen?: boolean;
35
- /** Uncontrolled mode: default open state */
36
- defaultOpen?: boolean;
37
- /** Callback when the open state changes */
38
- onOpenChange?: (open: boolean) => void;
39
- /** Custom ID for accessibility linking. Auto-generated if not provided. */
40
- id?: string;
41
- /** Custom anchor for positioning. Defaults to the trigger element. */
42
- anchorRef?: RefObject<HTMLElement>;
43
- } & (
44
- | {
45
- children?: never;
46
- targetRef: RefObject<T>;
47
- }
48
- | {
49
- children: ReactNode;
50
- targetRef?: never;
51
- }
52
- );
53
- elements: [
54
- 'toolTip',
55
- 'container',
56
- 'subHead',
57
- 'supportingText',
58
- 'actions',
59
- 'content',
60
- ];
61
- };
@@ -1,136 +0,0 @@
1
- import type { ClassNameComponent } from '../utils';
2
- import { classNames, createUseClassNames, defaultClassNames } from '../utils';
3
- import { ButtonInterface } from '../interfaces';
4
-
5
- const buttonConfig: ClassNameComponent<ButtonInterface> = ({
6
- variant,
7
- disableTextMargins,
8
- disabled,
9
- iconPosition,
10
- icon,
11
- isActive,
12
- loading,
13
- shape,
14
- onToggle,
15
- size,
16
- allowShapeTransformation,
17
- }) => ({
18
- button: classNames(
19
- ' relative cursor-pointer group/button outline-none inline-block flex w-fit justify-center items-center ',
20
- size === 'xSmall' && 'text-label-large px-3 py-1.5 gap-1',
21
- size === 'small' && 'text-label-large px-4 py-2.5 gap-2',
22
- size === 'medium' && 'text-title-medium px-6 py-4 gap-2',
23
- size === 'large' && 'text-headline-small px-12 py-8 gap-3',
24
- size === 'xLarge' && 'text-headline-large px-16 py-12 gap-4',
25
- shape === 'rounded' && {
26
- 'rounded-[30px]': size === 'xSmall' || size == 'small',
27
- 'rounded-[40px]': size === 'medium',
28
- 'rounded-[70px]': size === 'large' || size == 'xLarge',
29
- },
30
- (shape === 'squared' || (allowShapeTransformation && isActive)) && {
31
- 'rounded-[12px]': size === 'xSmall' || size == 'small',
32
- 'rounded-[16px]': size === 'medium',
33
- 'rounded-[28px]': size === 'large' || size == 'xLarge',
34
- },
35
- allowShapeTransformation &&
36
- !disabled && {
37
- 'active:rounded-[12px]': size === 'xSmall' || size == 'small',
38
- 'active:rounded-[16px]': size === 'medium',
39
- 'active:rounded-[28px]': size === 'large' || size == 'xLarge',
40
- },
41
- variant === 'elevated' && {
42
- 'shadow-1 hover:shadow-2': !disabled,
43
- 'bg-surface-container-low text-primary': !disabled && !isActive,
44
- 'bg-primary text-on-primary': !disabled && isActive,
45
- 'text-on-surface/[38%]': disabled,
46
- },
47
- variant === 'filled' && {
48
- 'hover:shadow-1': !disabled,
49
- 'bg-surface-container text-on-surface-variant':
50
- !disabled && !isActive && onToggle,
51
- 'bg-primary text-on-primary':
52
- !disabled && ((isActive && onToggle) || !onToggle),
53
- 'text-on-surface/[38%]': disabled,
54
- },
55
- variant === 'tonal' && {
56
- 'hover:shadow-1': !disabled,
57
- 'bg-secondary-container text-on-secondary-container':
58
- !disabled && !isActive,
59
- 'bg-secondary text-on-secondary': !disabled && isActive,
60
- 'text-on-surface/[0.38]': disabled,
61
- },
62
- variant === 'outlined' && [
63
- ' border',
64
- {
65
- 'border-on-surface/[0.12] text-on-surface/[0.38]': disabled,
66
-
67
- 'text-primary border-outline focus:border-primary':
68
- !disabled && !isActive,
69
- 'text-inverse-on-surface bg-inverse-surface border-inverse-surface':
70
- !disabled && isActive,
71
- },
72
- ],
73
- variant === 'text' && [
74
- 'w-fit',
75
- {
76
- 'text-primary': !disabled,
77
- 'text-on-surface/[0.38]': disabled,
78
- },
79
- disableTextMargins && [
80
- size === 'xSmall' && '-mx-3 ',
81
- size === 'small' && '-mx-4 ',
82
- size === 'medium' && '-mx-6 ',
83
- size === 'large' && '-mx-12',
84
- size === 'xLarge' && '-mx-16 ',
85
- // size === 'small' && ' -my-2.5',
86
- // size === 'medium' && ' -my-4',
87
- // size === 'large' && '-my-8',
88
- // size === 'xLarge' && ' -my-12',
89
- ],
90
- ],
91
- disabled && 'cursor-default',
92
- ),
93
- touchTarget: classNames(
94
- 'absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full',
95
- ),
96
- stateLayer: classNames(
97
- 'overflow-hidden',
98
- shape === 'rounded' && {
99
- 'rounded-[30px]': size === 'xSmall' || size == 'small',
100
- 'rounded-[40px]': size === 'medium',
101
- 'rounded-[70px]': size === 'large' || size == 'xLarge',
102
- },
103
- (shape === 'squared' || (allowShapeTransformation && isActive)) && {
104
- 'rounded-[12px]': size === 'xSmall' || size == 'small',
105
- 'rounded-[16px]': size === 'medium',
106
- 'rounded-[28px]': size === 'large' || size == 'xLarge',
107
- },
108
- allowShapeTransformation &&
109
- !disabled && {
110
- 'group-active/button:rounded-[12px]':
111
- size === 'xSmall' || size == 'small',
112
- 'group-active/button:rounded-[16px]': size === 'medium',
113
- 'group-active/button:rounded-[28px]':
114
- size === 'large' || size == 'xLarge',
115
- },
116
- ),
117
- label: classNames({ invisible: loading }),
118
- icon: classNames(
119
- { invisible: loading },
120
- size === 'xSmall' && 'size-5',
121
- size === 'small' && 'size-5',
122
- size === 'medium' && 'size-6',
123
- size === 'large' && 'size-8',
124
- size === 'xLarge' && 'size-10',
125
- ),
126
- });
127
-
128
- export const buttonStyle = defaultClassNames<ButtonInterface>(
129
- 'button',
130
- buttonConfig,
131
- );
132
-
133
- export const useButtonStyle = createUseClassNames<ButtonInterface>(
134
- 'button',
135
- buttonConfig,
136
- );
@@ -1,29 +0,0 @@
1
- import { CardInterface } from '../interfaces';
2
- import {
3
- type ClassNameComponent,
4
- classNames,
5
- createUseClassNames,
6
- defaultClassNames,
7
- } from '../utils';
8
-
9
- const cardConfig: ClassNameComponent<CardInterface> = ({
10
- variant,
11
- interactive,
12
- }) => ({
13
- card: classNames(
14
- ' rounded-xl overflow-hidden ',
15
- variant === 'outlined' && 'bg-surface border border-outline-variant',
16
- variant === 'elevated' && 'bg-surface-container-low shadow-1',
17
- variant === 'filled' && 'bg-surface-container-highest',
18
- {
19
- 'group/card cursor-pointer': interactive,
20
- },
21
- ),
22
- });
23
-
24
- export const cardStyle = defaultClassNames<CardInterface>('card', cardConfig);
25
-
26
- export const useCardStyle = createUseClassNames<CardInterface>(
27
- 'card',
28
- cardConfig,
29
- );
@@ -1,24 +0,0 @@
1
- import { CarouselItemInterface } from '../interfaces';
2
- import {
3
- type ClassNameComponent,
4
- classNames,
5
- createUseClassNames,
6
- defaultClassNames,
7
- } from '../utils';
8
-
9
- export const carouselItemConfig: ClassNameComponent<CarouselItemInterface> = () => {
10
- return {
11
- carouselItem: classNames('rounded-[28px] overflow-hidden flex-none', {
12
- }),
13
- };
14
- };
15
-
16
- export const carouselItemStyle = defaultClassNames<CarouselItemInterface>(
17
- 'carouselItem',
18
- carouselItemConfig,
19
- );
20
-
21
- export const useCarouselItemStyle = createUseClassNames<CarouselItemInterface>(
22
- 'carouselItem',
23
- carouselItemConfig,
24
- );
@@ -1,22 +0,0 @@
1
- import {
2
- type ClassNameComponent,
3
- classNames,
4
- createUseClassNames,
5
- defaultClassNames,
6
- } from '../utils';
7
- import { CarouselInterface } from '../interfaces';
8
-
9
- const carouselConfig: ClassNameComponent<CarouselInterface> = () => ({
10
- carousel: classNames(['w-full h-[400px]']),
11
- track: classNames('flex h-full w-full'),
12
- });
13
-
14
- export const carouselStyle = defaultClassNames<CarouselInterface>(
15
- 'carousel',
16
- carouselConfig,
17
- );
18
-
19
- export const useCarouselStyle = createUseClassNames<CarouselInterface>(
20
- 'carousel',
21
- carouselConfig,
22
- );
@@ -1,64 +0,0 @@
1
- import {
2
- type ClassNameComponent,
3
- classNames,
4
- createUseClassNames,
5
- defaultClassNames,
6
- } from '../utils';
7
- import { CheckboxInterface } from '../interfaces/checkbox.interface';
8
-
9
- const checkboxConfig: ClassNameComponent<CheckboxInterface> = ({
10
- isChecked,
11
- isIndeterminate,
12
- isDisabled,
13
- isError,
14
- isFocused,
15
- isHovered,
16
- }) => ({
17
- checkbox: classNames(
18
- 'inline-flex items-center justify-center relative size-4.5 ',
19
- {
20
- 'pointer-events-none opacity-[0.38]': isDisabled,
21
- },
22
- ),
23
- input: classNames(
24
- 'absolute inset-0 w-full h-full opacity-0 z-10 cursor-pointer',
25
- ),
26
- container: classNames(
27
- 'relative flex items-center justify-center w-[18px] h-[18px] ',
28
- ),
29
- box: classNames(
30
- 'absolute left-1/2 top-1/2 -translate-1/2 to rounded-[2px] size-4 border-2 transition-colors duration-200',
31
- // Unchecked state (Border only)
32
- !isChecked &&
33
- !isIndeterminate && {
34
- 'border-on-surface-variant': !isError && !isDisabled,
35
- 'border-error': isError && !isDisabled,
36
- 'border-on-surface': isDisabled,
37
- },
38
- // Checked or Indeterminate state (Filled)
39
- (isChecked || isIndeterminate) && {
40
- 'bg-primary border-primary': !isError && !isDisabled,
41
- 'bg-error border-error': isError && !isDisabled,
42
- 'bg-on-surface border-on-surface': isDisabled,
43
- },
44
- ),
45
- icon: classNames(
46
- 'z-10 relative text-on-primary w-full h-full flex items-center justify-center pointer-events-none',
47
- {
48
- 'text-on-error': isError && !isDisabled,
49
- 'text-surface': isDisabled, // Usually on-surface with opacity against on-surface bg? No, checked disabled is on-surface bg with surface icon usually.
50
- },
51
- ),
52
- stateLayer:
53
- 'size-10 state-ripple-group-[checkbox] rounded-full cursor-pointer pointer-events-auto absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2',
54
- });
55
-
56
- export const checkboxStyle = defaultClassNames<CheckboxInterface>(
57
- 'checkbox',
58
- checkboxConfig,
59
- );
60
-
61
- export const useCheckboxStyle = createUseClassNames<CheckboxInterface>(
62
- 'checkbox',
63
- checkboxConfig,
64
- );
@@ -1,62 +0,0 @@
1
- import type { ClassNameComponent } from '../utils';
2
- import { classNames, createUseClassNames, defaultClassNames } from '../utils';
3
- import { ChipInterface } from '../interfaces';
4
-
5
- const chipConfig: ClassNameComponent<ChipInterface> = ({
6
- variant,
7
-
8
- disabled,
9
- trailingIcon,
10
- icon,
11
- isActive,
12
- isInteractive,
13
- activated,
14
- isFocused,
15
- isDragging,
16
- isEditing,
17
- }) => ({
18
- chip: classNames(
19
- ' group/chip px-3 py-1.5 rounded-lg flex items-center gap-2 outline-none',
20
- {
21
- 'pl-2': icon,
22
- 'pr-2': trailingIcon,
23
- 'cursor-pointer': !disabled && isInteractive,
24
- },
25
- {
26
- ' text-on-surface-variant': (!activated && !isFocused) || isEditing,
27
- 'bg-secondary-container text-on-secondary-container':
28
- (activated || isFocused) && !isEditing,
29
- },
30
- // Dragging feedback
31
- isDragging && ['opacity-100 cursor-grabbing shadow-3'],
32
- variant === 'outlined' && [
33
- 'border border-outline-variant',
34
- {
35
- 'border-transparent': isEditing,
36
- },
37
- ],
38
- variant === 'elevated' &&
39
- !isEditing && [
40
- 'shadow-1 bg-surface-container-low',
41
- 'border border-outline-variant',
42
- ],
43
- ),
44
-
45
- stateLayer: classNames('rounded-lg overflow-hidden', {}),
46
- label: classNames('outline-none text-nowrap', {
47
- 'opacity-[0.38]': disabled,
48
- }),
49
- leadingIcon: classNames('text-primary size-[18px]', {
50
- 'opacity-[0.38]': disabled,
51
- }),
52
- trailingIcon: classNames('cursor-pointer size-[18px]', {
53
- 'opacity-[0.38]': disabled,
54
- }),
55
- });
56
-
57
- export const chipStyle = defaultClassNames<ChipInterface>('chip', chipConfig);
58
-
59
- export const useChipStyle = createUseClassNames<ChipInterface>(
60
- 'chip',
61
- chipConfig,
62
- );
@@ -1,20 +0,0 @@
1
- import type { ClassNameComponent } from '../utils';
2
- import { classNames, createUseClassNames, defaultClassNames } from '../utils';
3
- import { ChipsInterface } from '../interfaces';
4
-
5
- const chipsConfig: ClassNameComponent<ChipsInterface> = ({ scrollable }) => ({
6
- chips: classNames(' flex gap-3 outline-none', {
7
- 'flex-wrap': !scrollable,
8
- 'overflow-x-auto': scrollable,
9
- }),
10
- });
11
-
12
- export const chipsStyle = defaultClassNames<ChipsInterface>(
13
- 'chips',
14
- chipsConfig,
15
- );
16
-
17
- export const useChipsStyle = createUseClassNames<ChipsInterface>(
18
- 'chips',
19
- chipsConfig,
20
- );
@@ -1,43 +0,0 @@
1
- import {
2
- type ClassNameComponent,
3
- classNames,
4
- createUseClassNames,
5
- defaultClassNames,
6
- } from '../utils';
7
- import { DatePickerInterface } from '../interfaces/date-picker.interface';
8
-
9
- const datePickerConfig: ClassNameComponent<DatePickerInterface> = ({
10
- hasSelected,
11
- }) => ({
12
- datePicker: classNames(
13
- 'inline-flex flex-col bg-surface-container-high rounded-[28px] p-3 select-none', // Using shadow-sm as placeholder for elevation
14
- 'min-w-[320px]',
15
- ),
16
- header: classNames('flex items-center justify-between h-12 mb-2 px-2'),
17
- monthNav: classNames(
18
- 'flex items-center justify-center w-10 h-10 rounded-full text-on-surface-variant hover:bg-on-surface-variant/8 transition-colors cursor-pointer',
19
- ),
20
- monthLabel: classNames(
21
- 'text-label-large text-on-surface font-bold capitalize',
22
- ),
23
- weekDays: classNames('grid grid-cols-7 mb-2'),
24
- weekDay: classNames(
25
- 'h-10 flex items-center justify-center text-body-small text-on-surface-variant',
26
- ),
27
- daysGrid: classNames('grid grid-cols-7 row-auto gap-y-2'),
28
- dayCell: classNames('flex items-center justify-center h-10 p-0 relative'),
29
- dayButton: classNames(
30
- 'w-10 h-10 rounded-full flex items-center justify-center text-body-large transition-all duration-200 relative overflow-hidden z-10 outline-none',
31
- // Base style is implicit text-on-surface
32
- ),
33
- });
34
-
35
- export const datePickerStyle = defaultClassNames<DatePickerInterface>(
36
- 'datePicker',
37
- datePickerConfig,
38
- );
39
-
40
- export const useDatePickerStyle = createUseClassNames<DatePickerInterface>(
41
- 'datePicker',
42
- datePickerConfig,
43
- );
@@ -1,31 +0,0 @@
1
- import { DividerInterface } from '../interfaces';
2
- import {
3
- type ClassNameComponent,
4
- classNames,
5
- createUseClassNames,
6
- defaultClassNames,
7
- } from '../utils';
8
-
9
- const dividerConfig: ClassNameComponent<DividerInterface> = ({
10
- orientation,
11
- }) => ({
12
- divider: classNames(
13
- 'border-outline-variant ',
14
- {
15
- 'h-fit w-full border-t': orientation === 'horizontal',
16
- },
17
- {
18
- 'h-auto self-stretch w-fit border-l': orientation === 'vertical',
19
- },
20
- ),
21
- });
22
-
23
- export const dividerStyle = defaultClassNames<DividerInterface>(
24
- 'divider',
25
- dividerConfig,
26
- );
27
-
28
- export const useDividerStyle = createUseClassNames<DividerInterface>(
29
- 'divider',
30
- dividerConfig,
31
- );
@@ -1,29 +0,0 @@
1
- import {
2
- type ClassNameComponent,
3
- classNames,
4
- createUseClassNames,
5
- defaultClassNames,
6
- } from '../utils';
7
- import { FabMenuInterface } from '../interfaces/fab-menu.interface';
8
-
9
- const fabMenuConfig: ClassNameComponent<FabMenuInterface> = ({
10
- size,
11
- variant,
12
- open,
13
- }) => ({
14
- fabMenu: classNames('relative inline-flex flex-col items-end'),
15
- actions: classNames(
16
- 'flex flex-col gap-1 items-end absolute bottom-[calc(100%_+_8px)] right-0',
17
- ),
18
- label: classNames('text-nowrap'),
19
- });
20
-
21
- export const fabMenuStyle = defaultClassNames<FabMenuInterface>(
22
- 'fabMenu',
23
- fabMenuConfig,
24
- );
25
-
26
- export const useFabMenuStyle = createUseClassNames<FabMenuInterface>(
27
- 'fabMenu',
28
- fabMenuConfig,
29
- );
@@ -1,49 +0,0 @@
1
- import {
2
- type ClassNameComponent,
3
- classNames,
4
- createUseClassNames,
5
- defaultClassNames,
6
- } from '../utils';
7
- import { FabInterface } from '../interfaces/fab.interface';
8
-
9
- const fabConfig: ClassNameComponent<FabInterface> = ({
10
- size,
11
- variant,
12
- extended,
13
- }) => ({
14
- fab: classNames(
15
- 'flex shadow-3 hover:shadow-4 group/fab overflow-hidden outline-none items-center cursor-pointer',
16
- {
17
- 'rounded-[12px]': size == 'small',
18
- 'rounded-[16px]': size == 'medium',
19
- 'rounded-[28px]': size == 'large',
20
- },
21
- {
22
- 'p-2': size == 'small',
23
- 'p-4': size == 'medium',
24
- 'p-[30px]': size == 'large',
25
- },
26
- variant === 'primary' && 'bg-primary text-on-primary',
27
- variant === 'secondary' && 'bg-secondary text-on-secondary',
28
- variant === 'tertiary' && 'bg-tertiary text-on-tertiary',
29
- variant === 'primaryContainer' &&
30
- 'bg-primary-container text-on-primary-container',
31
- variant === 'secondaryContainer' &&
32
- 'bg-secondary-container text-on-secondary-container',
33
- variant === 'tertiaryContainer' &&
34
- 'bg-tertiary-container text-on-tertiary-container',
35
- ),
36
- icon: classNames({
37
- 'size-6': size == 'small' || size == 'medium',
38
- 'size-9': size == 'large',
39
- }),
40
- label: classNames('text-nowrap', {
41
- 'text-title-medium': size == 'small',
42
- 'text-title-large': size == 'medium',
43
- 'text-headline-small': size == 'large',
44
- }),
45
- });
46
-
47
- export const fabStyle = defaultClassNames<FabInterface>('fab', fabConfig);
48
-
49
- export const useFabStyle = createUseClassNames<FabInterface>('fab', fabConfig);