@yamatozhen/design_system 1.0.1 → 1.2.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.
Files changed (156) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +101 -101
  3. package/package.json +50 -50
  4. package/scripts/postinstall.js +91 -91
  5. package/template/app/ClientNav.tsx +258 -310
  6. package/template/app/globals.css +2 -167
  7. package/template/app/layout.tsx +94 -82
  8. package/template/app/themes/dark-mc.css +51 -51
  9. package/template/app/themes/dark.css +51 -51
  10. package/template/app/themes/light-mc.css +51 -51
  11. package/template/app/themes/light.css +51 -51
  12. package/template/app/themes/theme.css +272 -82
  13. package/template/components/{layout/button → (buttons)}/Button.module.css +351 -305
  14. package/template/components/{layout/button → (buttons)}/ButtonGroup.tsx +414 -503
  15. package/template/components/{layout/button → (buttons)}/FAB.tsx +119 -118
  16. package/template/components/(buttons)/button.tsx +164 -0
  17. package/template/components/(controls)/slider/Slider.module.css +250 -0
  18. package/template/components/(controls)/slider/Slider.tsx +386 -0
  19. package/template/components/{layout → (controls)}/switch/Switch.module.css +108 -102
  20. package/template/components/{layout → (controls)}/switch/Switch.tsx +69 -48
  21. package/template/components/(date & time)/calendar/Calendar.module.css +125 -0
  22. package/template/components/(date & time)/calendar/Calendar.tsx +206 -0
  23. package/template/components/(date & time)/dateField/DateField.module.css +25 -0
  24. package/template/components/(date & time)/dateField/DateField.tsx +193 -0
  25. package/template/components/(date & time)/datePicker/DatePicker.tsx +118 -0
  26. package/template/components/(date & time)/dateRangePicker/DateRangePicker.tsx +144 -0
  27. package/template/components/(date & time)/rangeCalendar/RangeCalendar.module.css +203 -0
  28. package/template/components/(date & time)/rangeCalendar/RangeCalendar.tsx +263 -0
  29. package/template/components/(date & time)/shared/dateUtils.ts +107 -0
  30. package/template/components/(date & time)/timeField/TimeField.module.css +39 -0
  31. package/template/components/(date & time)/timeField/TimeField.tsx +158 -0
  32. package/template/components/(feedback)/circularProgress/CircularProgress.tsx +646 -0
  33. package/template/components/(feedback)/linearProgress/LinearProgress.tsx +337 -0
  34. package/template/components/(feedback)/meter/Meter.tsx +111 -0
  35. package/template/components/(feedback)/skeleton/Skeleton.module.css +49 -0
  36. package/template/components/(feedback)/skeleton/Skeleton.tsx +32 -0
  37. package/template/components/(feedback)/spinner/Spinner.module.css +27 -0
  38. package/template/components/(feedback)/spinner/Spinner.tsx +60 -0
  39. package/template/components/(forms)/checkbox/Checkbox.tsx +121 -0
  40. package/template/components/(forms)/checkboxGroup/CheckboxGroup.tsx +83 -0
  41. package/template/components/(forms)/description/Description.tsx +34 -0
  42. package/template/components/(forms)/errorMessage/ErrorMessage.tsx +31 -0
  43. package/template/components/(forms)/fieldError/FieldError.tsx +39 -0
  44. package/template/components/(forms)/fieldset/Fieldset.tsx +51 -0
  45. package/template/components/(forms)/form/Form.tsx +54 -0
  46. package/template/components/(forms)/input/Input.tsx +50 -0
  47. package/template/components/(forms)/inputGroup/InputGroup.tsx +65 -0
  48. package/template/components/(forms)/inputOtp/InputOtp.tsx +139 -0
  49. package/template/components/(forms)/label/Label.tsx +46 -0
  50. package/template/components/(forms)/numberField/NumberField.tsx +292 -0
  51. package/template/components/(forms)/radioGroup/RadioGroup.tsx +175 -0
  52. package/template/components/(forms)/searchField/SearchField.tsx +139 -0
  53. package/template/components/(forms)/shared/field.module.css +75 -0
  54. package/template/components/(forms)/shared/fieldContext.ts +28 -0
  55. package/template/components/(forms)/textArea/TextArea.tsx +55 -0
  56. package/template/components/(forms)/textField/TextField.tsx +91 -0
  57. package/template/components/{layout → (layout)}/Lightbox/LightboxCard.tsx +100 -100
  58. package/template/components/{layout → (layout)}/Lightbox/LightboxGallery.module.css +249 -249
  59. package/template/components/{layout → (layout)}/Lightbox/LightboxGallery.tsx +72 -72
  60. package/template/components/{layout → (layout)}/Lightbox/LightboxGrid.tsx +185 -186
  61. package/template/components/{layout → (layout)}/Lightbox/LightboxModal.module.css +395 -395
  62. package/template/components/{layout → (layout)}/Lightbox/LightboxModal.tsx +498 -500
  63. package/template/components/{layout → (layout)}/Lightbox/demo.tsx +396 -412
  64. package/template/components/{layout → (layout)}/Lightbox/index.ts +30 -30
  65. package/template/components/{layout → (layout)}/Lightbox/types.ts +101 -113
  66. package/template/components/{layout → (layout)}/Lightbox/useLightboxFilters.ts +140 -140
  67. package/template/components/(layout)/accordion/Accordion.module.css +108 -0
  68. package/template/components/(layout)/accordion/Accordion.tsx +251 -0
  69. package/template/components/(layout)/card/Card.module.css +136 -0
  70. package/template/components/(layout)/card/Card.tsx +371 -0
  71. package/template/components/(layout)/list/List.module.css +83 -0
  72. package/template/components/(layout)/list/List.tsx +332 -0
  73. package/template/components/{layout → (layout)}/navigation/Wrap.tsx +41 -41
  74. package/template/components/(layout)/navigation/breadcrumbs/Breadcrumbs.tsx +145 -0
  75. package/template/components/{layout/navigation/nav/Nav.module.css → (layout)/navigation/nav/Nav.module.css.old} +474 -508
  76. package/template/components/{layout → (layout)}/navigation/nav/Nav.tsx +186 -167
  77. package/template/components/{layout → (layout)}/navigation/nav/NavBar.tsx +396 -419
  78. package/template/components/{layout → (layout)}/navigation/nav/NavContext.tsx +259 -259
  79. package/template/components/{layout → (layout)}/navigation/nav/NavItem.tsx +195 -173
  80. package/template/components/{layout → (layout)}/navigation/nav/NavNew.module.css +406 -373
  81. package/template/components/{layout → (layout)}/navigation/nav/NavRail.tsx +317 -315
  82. package/template/components/{layout → (layout)}/navigation/nav/NavSection.tsx +101 -102
  83. package/template/components/{layout → (layout)}/navigation/nav/NavTab.tsx +25 -25
  84. package/template/components/{layout → (layout)}/navigation/nav/navftb/NavFTB.module.css +253 -252
  85. package/template/components/{layout → (layout)}/navigation/nav/navftb/NavFTB.tsx +448 -399
  86. package/template/components/{layout → (layout)}/navigation/nav/navftb/useTabIndicator.ts +498 -484
  87. package/template/components/{layout → (layout)}/navigation/nav/navheader/NavHeader.module.css +59 -59
  88. package/template/components/{layout → (layout)}/navigation/nav/navheader/NavHeader.tsx +465 -473
  89. package/template/components/(layout)/navigation/pagination/Pagination.tsx +261 -0
  90. package/template/components/{layout → (layout)}/pages/loadingScreen.tsx +117 -102
  91. package/template/components/{layout → (layout)}/pages/maintenance/Maintenance.tsx +52 -52
  92. package/template/components/{layout → (layout)}/pages/maintenance/maintenance.module.css +162 -162
  93. package/template/components/(layout)/scrollShadow/ScrollShadow.module.css +81 -0
  94. package/template/components/(layout)/scrollShadow/ScrollShadow.tsx +161 -0
  95. package/template/components/(layout)/scrollShadow/useScrollShadow.ts +130 -0
  96. package/template/components/(layout)/separator/Separator.tsx +112 -0
  97. package/template/components/(overlays)/accessibilityModal/AccessibilityModal.tsx +307 -0
  98. package/template/components/(overlays)/drawer/Drawer.tsx +953 -0
  99. package/template/components/(overlays)/modal/Modal.tsx +654 -0
  100. package/template/components/(overlays)/popover/Popover.tsx +420 -0
  101. package/template/components/(overlays)/toast/Toast.tsx +692 -0
  102. package/template/components/(pickers)/autocomplete/Autocomplete.tsx +24 -0
  103. package/template/components/(pickers)/comboBox/ComboBox.tsx +21 -0
  104. package/template/components/(pickers)/select/Select.tsx +188 -0
  105. package/template/components/(pickers)/shared/FilterableField.tsx +223 -0
  106. package/template/components/(pickers)/shared/PickerItem.ts +13 -0
  107. package/template/components/tools/CustomScrollbar.tsx +107 -0
  108. package/template/components/tools/Divider.tsx +11 -11
  109. package/template/components/tools/ReduceMotionContext.tsx +5 -5
  110. package/template/components/tools/Sinewave.tsx +396 -199
  111. package/template/components/tools/SinewaveProgress.tsx +140 -135
  112. package/template/components/tools/badge/Badge.tsx +28 -28
  113. package/template/components/tools/dropdown/drop.module.css +196 -0
  114. package/template/components/tools/dropdown/drop.tsx +568 -0
  115. package/template/components/tools/easing.ts +118 -0
  116. package/template/components/tools/flubber.d.ts +6 -6
  117. package/template/components/tools/footer/Footer.tsx +20 -0
  118. package/template/components/tools/input/Input.module.css +45 -0
  119. package/template/components/tools/input/Input.tsx +99 -0
  120. package/template/components/tools/label/Icon.tsx +39 -0
  121. package/template/components/tools/label/Label.tsx +156 -0
  122. package/template/components/tools/mobileViewProvider.tsx +53 -58
  123. package/template/components/tools/ripple/ripple.css +38 -41
  124. package/template/components/tools/ripple/ripple.tsx +78 -53
  125. package/template/components/tools/shape/Shape.module.css +25 -0
  126. package/template/components/tools/shape/{ShapeMorph.tsx → Shape.tsx} +316 -190
  127. package/template/components/tools/shape/ShapeLoader.tsx +104 -101
  128. package/template/components/tools/shape/ShapePaths.ts +116 -116
  129. package/template/components/tools/switch/Switch.module.css +102 -102
  130. package/template/components/tools/switch/Switch.tsx +48 -48
  131. package/template/components/tools/useBodyScrollLock.tsx +27 -27
  132. package/template/components/tools/useImageColor.ts +47 -47
  133. package/template/components/tools/useNavSheetDrag.tsx +196 -196
  134. package/template/components/layout/accordion/Accordion.module.css +0 -149
  135. package/template/components/layout/accordion/Accordion.tsx +0 -114
  136. package/template/components/layout/button/button.tsx +0 -128
  137. package/template/components/layout/button/drop.module.css +0 -229
  138. package/template/components/layout/button/drop.tsx +0 -516
  139. package/template/components/layout/hero/v1/heroSlideshow.module.css +0 -107
  140. package/template/components/layout/hero/v1/heroSlideshow.tsx +0 -233
  141. package/template/components/layout/modals/accessibilityModal/AccessibilityModal.module.css +0 -126
  142. package/template/components/layout/modals/accessibilityModal/AccessibilityModal.tsx +0 -290
  143. package/template/components/layout/modals/alert/Alert.tsx +0 -188
  144. package/template/components/layout/navigation/MioCard.module.css +0 -88
  145. package/template/components/layout/navigation/MioCard.tsx +0 -266
  146. package/template/components/tools/ProgressiveBlur.tsx +0 -73
  147. package/template/components/tools/icon/icon.module.css +0 -0
  148. package/template/components/tools/icon/icon.tsx +0 -125
  149. package/template/components/tools/react-bits/ClickSpark.tsx +0 -177
  150. package/template/components/tools/react-bits/FadeContent.tsx +0 -90
  151. package/template/components/tools/react-bits/GlareHover.tsx +0 -73
  152. package/template/components/tools/react-bits/GradientText/GradientText.css +0 -70
  153. package/template/components/tools/react-bits/GradientText/GradientText.tsx +0 -44
  154. package/template/components/tools/react-bits/Magnet.tsx +0 -118
  155. package/template/components/tools/react-bits/Stepper/Stepper.css +0 -134
  156. package/template/components/tools/react-bits/Stepper/Stepper.tsx +0 -412
@@ -1,128 +0,0 @@
1
- "use client";
2
-
3
- import React, { useRef } from "react";
4
- import styles from "./Button.module.css";
5
- import Ripple, { RippleHandle } from "@/components/tools/ripple/ripple";
6
- import ButtonGroup from "./ButtonGroup";
7
-
8
- type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
9
- // variant booleans — first truthy one wins; defaults to "primary"
10
- primary?: boolean;
11
- "primary-bold"?: boolean;
12
- secondary?: boolean;
13
- "secondary-bold"?: boolean;
14
- tertiary?: boolean;
15
- "tertiary-bold"?: boolean;
16
- outlined?: boolean;
17
- text?: boolean;
18
- link?: boolean;
19
- // mode booleans — first truthy one wins; defaults to "icon-label"
20
- loading?: boolean;
21
- elevated?: boolean;
22
- rippleColor?: string;
23
- };
24
-
25
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
26
- (
27
- {
28
- "primary-bold": primaryBold,
29
- primary,
30
- "secondary-bold": secondaryBold,
31
- secondary,
32
- "tertiary-bold": tertiaryBold,
33
- tertiary,
34
- outlined,
35
- text,
36
- link,
37
- loading = false,
38
- disabled,
39
- onClick,
40
- children,
41
- elevated = false,
42
- rippleColor,
43
- ...rest
44
- },
45
- ref,
46
- ) => {
47
- const variant = primaryBold
48
- ? "primary-bold"
49
- : primary
50
- ? "primary"
51
- : secondaryBold
52
- ? "secondary-bold"
53
- : secondary
54
- ? "secondary"
55
- : tertiaryBold
56
- ? "tertiary-bold"
57
- : tertiary
58
- ? "tertiary"
59
- : outlined
60
- ? "outlined"
61
- : text
62
- ? "text"
63
- : link
64
- ? "link"
65
- : "primary";
66
-
67
- if (process.env.NODE_ENV !== "production") {
68
- const variantCount = [
69
- primaryBold,
70
- primary,
71
- secondaryBold,
72
- secondary,
73
- tertiaryBold,
74
- tertiary,
75
- outlined,
76
- text,
77
- link,
78
- ].filter(Boolean).length;
79
- if (variantCount === 0) {
80
- console.warn(
81
- "<Button>: No variant prop provided. Specify one of: primary, primary-bold, secondary, secondary-bold, tertiary, tertiary-bold, outlined, text, link.",
82
- );
83
- } else if (variantCount > 1) {
84
- console.warn(
85
- "<Button>: Multiple variant props provided — only the first truthy one is used. Remove the extras.",
86
- );
87
- }
88
- }
89
-
90
- const rippleRef = useRef<RippleHandle>(null);
91
-
92
- const isDisabled = disabled || loading;
93
-
94
- const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
95
- if (!isDisabled) {
96
- rippleRef.current?.triggerRipple(e);
97
- onClick?.(e);
98
- }
99
- };
100
-
101
- return (
102
- <button
103
- ref={ref}
104
- disabled={isDisabled}
105
- className={`${styles[variant]} ${styles.buttonStyle}`}
106
- onClick={handleClick}
107
- {...rest}
108
- style={
109
- elevated && !isDisabled
110
- ? {
111
- boxShadow:
112
- "0 1px 2px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1)",
113
- ...rest.style,
114
- }
115
- : rest.style
116
- }
117
- >
118
- {children}
119
- {/* Always render Ripple; handle disabled in trigger */}
120
- <Ripple ref={rippleRef} rippleColor={rippleColor} />
121
- </button>
122
- );
123
- },
124
- );
125
-
126
- Button.displayName = "Button";
127
-
128
- export default Object.assign(Button, { group: ButtonGroup });
@@ -1,229 +0,0 @@
1
- /* ── Wrapper: holds the invisible spacer (in flow) + absolute layers ───────── */
2
- .root {
3
- position: relative;
4
- display: inline-flex;
5
- max-width: max-content;
6
- }
7
-
8
- /* ── Shared pill/card box (spacer + the real drop both use this) ───────────── */
9
- .pillBox {
10
- box-sizing: border-box;
11
- display: inline-flex;
12
- flex-direction: column;
13
- align-items: stretch;
14
- max-width: max-content;
15
- padding: 6px;
16
-
17
- font-size: var(--font-size-base);
18
- font-weight: 400;
19
- border: 1px solid var(--globalUIBorderCard);
20
- border-radius: 34px; /* radius is overridden by Framer on the live drop */
21
- overflow: hidden;
22
- transform: translateY(0px);
23
-
24
- -webkit-tap-highlight-color: transparent;
25
- touch-action: manipulation;
26
- user-select: none;
27
- cursor: pointer;
28
- filter: brightness(1);
29
-
30
- transition:
31
- background-color var(--transition-expressive-color),
32
- color var(--transition-expressive-color),
33
- box-shadow var(--transition-expressive),
34
- border-color var(--transition-expressive-color),
35
- filter var(--transition-expressive-color);
36
- }
37
-
38
- /* The clone just holds space — never seen, never interactive. */
39
- .spacer {
40
- visibility: hidden;
41
- }
42
-
43
- /* Offscreen clone of the open card — measured for the expanded width only. */
44
- .measure {
45
- position: absolute;
46
- top: 0;
47
- left: -9999px;
48
- visibility: hidden;
49
- pointer-events: none;
50
- }
51
-
52
- /* The live element floats over the spacer and grows downward. */
53
- .drop {
54
- position: absolute;
55
- top: 0;
56
- left: 0;
57
- z-index: 5;
58
- transform-origin: top center;
59
- }
60
- .drop[data-open="false"]:hover {
61
- filter: var(--filterBrightness);
62
- }
63
-
64
- /* ── Variant surfaces (collapsed) — same names as button.tsx bools ─────────── */
65
- .primary {
66
- background: var(--md-sys-color-primary-container);
67
- color: var(--md-sys-color-on-primary-container);
68
- }
69
- .secondary {
70
- background: var(--md-sys-color-secondary-container);
71
- color: var(--md-sys-color-on-secondary-container);
72
- }
73
- .tertiary {
74
- background: var(--md-sys-color-tertiary-container);
75
- color: var(--md-sys-color-on-tertiary-container);
76
- }
77
- .outlined {
78
- background: transparent;
79
- color: var(--md-sys-color-secondary);
80
- border-width: 2px;
81
- border-color: var(--md-sys-color-outline-variant);
82
- }
83
- .text {
84
- background: transparent;
85
- color: var(--md-sys-color-primary);
86
- border: 0;
87
- }
88
- .link {
89
- background: transparent;
90
- color: var(--md-sys-color-tertiary);
91
- border: 0;
92
- text-decoration: underline;
93
- }
94
-
95
- /* ── Open state: becomes a surface-container-low card (any variant) ────────── */
96
- .drop[data-open="true"] {
97
- background: var(--md-sys-color-surface-container-lowest);
98
- color: var(--md-sys-color-on-surface);
99
- border: 1px solid var(--globalUIBorderCard);
100
- box-shadow:
101
- 0 1px 1px rgba(0, 0, 0, 0.1),
102
- 0 2px 2px rgba(0, 0, 0, 0.1),
103
- 0 4px 4px rgba(0, 0, 0, 0.1);
104
- }
105
-
106
- :global([data-show-borders="true"]) .drop,
107
- :global([data-show-borders="true"]) .submenuCard {
108
- border: var(--a11y-border) !important;
109
- }
110
-
111
- /* ── Header: pill content closed, dimmed title open ───────────────────────── */
112
- .header {
113
- appearance: none;
114
- -webkit-appearance: none;
115
- background: transparent;
116
- border: 0;
117
- margin: 0;
118
- color: inherit;
119
- font: inherit;
120
-
121
- display: flex;
122
- align-items: center;
123
- justify-content: flex-start;
124
- gap: 8px;
125
- min-height: 30px; /* + 6px padding × 2 + 1px border × 2 ≈ 44px collapsed */
126
- padding: 0 8px;
127
- white-space: nowrap;
128
- cursor: pointer;
129
- border-radius: inherit;
130
-
131
- transition: opacity var(--transition-expressive-color);
132
- }
133
- .drop[data-open="true"] .header {
134
- opacity: 0.62;
135
- }
136
-
137
- /* ── Rows ─────────────────────────────────────────────────────────────────── */
138
- .list,
139
- .submenuList {
140
- list-style: none;
141
- margin: 0;
142
- padding: 0;
143
- display: flex;
144
- flex-direction: column;
145
- }
146
- .list li,
147
- .submenuList li {
148
- list-style: none;
149
- }
150
-
151
- .row {
152
- appearance: none;
153
- -webkit-appearance: none;
154
- width: 100%;
155
- box-sizing: border-box;
156
- display: flex;
157
- align-items: center;
158
- gap: 8px;
159
- padding: 8px 12px;
160
- height: 44px;
161
- margin: 0;
162
-
163
- background: transparent;
164
- border: 0;
165
- border-radius: 34px;
166
- color: inherit;
167
- font: inherit;
168
- text-align: start;
169
- text-decoration: none;
170
- white-space: nowrap;
171
- cursor: pointer;
172
-
173
- transition:
174
- background-color var(--transition-expressive-color),
175
- color var(--transition-expressive-color);
176
- }
177
- .row:hover {
178
- background: var(--globalUIBorderCard);
179
- }
180
-
181
- /* ── Active / toggled row ─────────────────────────────────────────────────── */
182
- .row[data-active] {
183
- background: var(--md-sys-color-secondary-container);
184
- color: var(--md-sys-color-on-secondary-container);
185
- }
186
- .row[data-active]:hover {
187
- background: var(--md-sys-color-secondary-container);
188
- filter: var(--filterBrightness);
189
- }
190
-
191
- /* Text-only rows indent to line up with icon rows — tweak to your <Icon> box. */
192
- .row[data-noicon] {
193
- padding-inline-start: 34px;
194
- }
195
-
196
- .chev {
197
- margin-inline-start: auto;
198
- display: inline-flex;
199
- align-items: center;
200
- }
201
-
202
- /* Passthrough rows (e.g. <Divider/>) — just breathing room; the component draws itself. */
203
- .dividerRow {
204
- list-style: none;
205
- display: block;
206
- padding: 6px;
207
- max-height: 1px;
208
- }
209
-
210
- /* ── Submenu card ─────────────────────────────────────────────────────────── */
211
- .submenuCard {
212
- position: absolute;
213
- left: 0;
214
- z-index: 6;
215
- box-sizing: border-box;
216
- width: max-content;
217
- padding: 6px;
218
-
219
- background: var(--md-sys-color-surface-container-lowest);
220
- color: var(--md-sys-color-on-surface);
221
- border: 1px solid var(--globalUIBorderCard);
222
- border-radius: 30px;
223
- overflow: hidden;
224
- box-shadow:
225
- 0 1px 1px rgba(0, 0, 0, 0.1),
226
- 0 2px 2px rgba(0, 0, 0, 0.1),
227
- 0 4px 4px rgba(0, 0, 0, 0.1);
228
- transform-origin: top center;
229
- }