@stamcat/craftsman 0.0.27-alpha.2 → 0.0.27-alpha.20

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 (200) hide show
  1. package/AGENTS.md +16 -344
  2. package/Components.esm.js +66 -11
  3. package/README.md +5 -0
  4. package/Styles.esm.js +7 -7
  5. package/Utilities.esm.js +2 -2
  6. package/_virtual/_rolldown/runtime.esm.js +18 -6
  7. package/package.json +62 -6
  8. package/src/components/Button/AGENTS.md +64 -0
  9. package/src/components/{Button.d.ts → Button/Button.d.ts} +1 -1
  10. package/src/components/Button/Button.esm.js +25 -0
  11. package/src/components/Carousel/AGENTS.md +41 -0
  12. package/src/components/Carousel/Carousel.css +1 -0
  13. package/src/components/Carousel/Carousel.d.ts +11 -0
  14. package/src/components/Carousel/Carousel.scss +34 -0
  15. package/src/components/Carousel/Carousel2.esm.js +75 -0
  16. package/src/components/Checkbox/AGENTS.md +32 -0
  17. package/src/components/Checkbox/Checkbox.d.ts +7 -0
  18. package/src/components/{Checkbox.esm.js → Checkbox/Checkbox.esm.js} +2 -2
  19. package/src/components/DatePicker/AGENTS.md +36 -0
  20. package/src/components/DatePicker/DatePicker.css +1 -0
  21. package/src/components/DatePicker/DatePicker.d.ts +8 -0
  22. package/src/components/DatePicker/DatePicker.scss +61 -0
  23. package/src/components/DatePicker/DatePicker2.esm.js +29 -0
  24. package/src/components/DatePicker/ReactCalendar.css +1 -0
  25. package/src/components/DatePicker/ReactCalendar.scss +158 -0
  26. package/src/components/DatePicker/_DatePicker.scss +73 -0
  27. package/src/components/DateRangePicker/AGENTS.md +38 -0
  28. package/src/components/DateRangePicker/DateRangePicker.css +1 -0
  29. package/src/components/DateRangePicker/DateRangePicker.d.ts +8 -0
  30. package/src/components/DateRangePicker/DateRangePicker.scss +62 -0
  31. package/src/components/DateRangePicker/DateRangePicker2.esm.js +29 -0
  32. package/src/components/DateTimePicker/AGENTS.md +41 -0
  33. package/src/components/DateTimePicker/DateTimePicker.css +1 -0
  34. package/src/components/DateTimePicker/DateTimePicker.d.ts +13 -0
  35. package/src/components/DateTimePicker/DateTimePicker.scss +86 -0
  36. package/src/components/DateTimePicker/DateTimePicker2.esm.js +82 -0
  37. package/src/components/Icons/IconAmazonPay.d.ts +2 -0
  38. package/src/components/Icons/IconAmazonPay.esm.js +76 -0
  39. package/src/components/Icons/IconAmex.d.ts +2 -0
  40. package/src/components/Icons/IconAmex.esm.js +87 -0
  41. package/src/components/Icons/IconApplePay.d.ts +2 -0
  42. package/src/components/Icons/IconApplePay.esm.js +26 -0
  43. package/src/components/Icons/IconDiscover.d.ts +2 -0
  44. package/src/components/Icons/IconDiscover.esm.js +129 -0
  45. package/src/components/Icons/IconGooglePay.d.ts +2 -0
  46. package/src/components/Icons/IconGooglePay.esm.js +64 -0
  47. package/src/components/Icons/IconMaestro.d.ts +2 -0
  48. package/src/components/Icons/IconMaestro.esm.js +38 -0
  49. package/src/components/Icons/IconMastercard.d.ts +2 -0
  50. package/src/components/Icons/IconMastercard.esm.js +27 -0
  51. package/src/components/Icons/IconPayPal.d.ts +2 -0
  52. package/src/components/Icons/IconPayPal.esm.js +52 -0
  53. package/src/components/Icons/IconSepa.d.ts +2 -0
  54. package/src/components/Icons/IconSepa.esm.js +272 -0
  55. package/src/components/Icons/IconShopPay.d.ts +2 -0
  56. package/src/components/Icons/IconShopPay.esm.js +35 -0
  57. package/src/components/Icons/IconSquare.d.ts +2 -0
  58. package/src/components/Icons/IconSquare.esm.js +11 -0
  59. package/src/components/Icons/IconStripe.d.ts +2 -0
  60. package/src/components/Icons/IconStripe.esm.js +57 -0
  61. package/src/components/Icons/IconUnionPay.d.ts +2 -0
  62. package/src/components/Icons/IconUnionPay.esm.js +28 -0
  63. package/src/components/Icons/IconVenmo.d.ts +2 -0
  64. package/src/components/Icons/IconVenmo.esm.js +21 -0
  65. package/src/components/Icons/IconVisa.d.ts +2 -0
  66. package/src/components/Icons/IconVisa.esm.js +14 -0
  67. package/src/components/Icons/index.d.ts +15 -0
  68. package/src/components/Icons/index.esm.js +16 -0
  69. package/src/components/Icons/types.d.ts +4 -0
  70. package/src/components/Input/AGENTS.md +30 -0
  71. package/src/components/Input/Input.css +1 -0
  72. package/src/components/Input/Input.d.ts +6 -0
  73. package/src/components/Input/Input.scss +176 -0
  74. package/src/components/Input/Input2.esm.js +42 -0
  75. package/src/components/Input/InputWrapper.d.ts +11 -0
  76. package/src/components/Input/InputWrapper.esm.js +22 -0
  77. package/src/components/InputNumber/AGENTS.md +36 -0
  78. package/src/components/InputNumber/InputNumber.css +1 -0
  79. package/src/components/InputNumber/InputNumber.d.ts +9 -0
  80. package/src/components/InputNumber/InputNumber.scss +29 -0
  81. package/src/components/InputNumber/InputNumber2.esm.js +36 -0
  82. package/src/components/InputPassword/AGENTS.md +29 -0
  83. package/src/components/{InputPassword.d.ts → InputPassword/InputPassword.d.ts} +2 -2
  84. package/src/components/InputPassword/InputPassword.esm.js +30 -0
  85. package/src/components/InputPhone/AGENTS.md +35 -0
  86. package/src/components/InputPhone/InputPhone.css +1 -0
  87. package/src/components/InputPhone/InputPhone.d.ts +7 -0
  88. package/src/components/InputPhone/InputPhone.scss +266 -0
  89. package/src/components/InputPhone/InputPhone2.esm.js +27 -0
  90. package/src/components/Loader/AGENTS.md +31 -0
  91. package/src/components/{Loader.d.ts → Loader/Loader.d.ts} +1 -2
  92. package/src/components/Loader/Loader.esm.js +19 -0
  93. package/src/components/Loader/loaders.module.css +1 -0
  94. package/src/components/Loader/loaders.module.esm.js +21 -0
  95. package/src/{styles/global/components → components/Loader}/loaders.module.scss +2 -1
  96. package/src/components/Modal/AGENTS.md +47 -0
  97. package/src/components/Modal/Modal.css +1 -0
  98. package/src/components/{Modal.d.ts → Modal/Modal.d.ts} +0 -1
  99. package/src/components/Modal/Modal.scss +150 -0
  100. package/src/components/Modal/Modal2.esm.js +53 -0
  101. package/src/components/Pagination/AGENTS.md +38 -0
  102. package/src/components/Pagination/Pagination.css +1 -0
  103. package/src/components/Pagination/Pagination.d.ts +10 -0
  104. package/src/components/Pagination/Pagination.scss +22 -0
  105. package/src/components/Pagination/Pagination2.esm.js +64 -0
  106. package/src/components/RadioButton/AGENTS.md +42 -0
  107. package/src/components/RadioButton/RadioButton.d.ts +8 -0
  108. package/src/components/{RadioButton.esm.js → RadioButton/RadioButton.esm.js} +2 -2
  109. package/src/components/Select/AGENTS.md +36 -0
  110. package/src/components/Select/Select.d.ts +14 -0
  111. package/src/components/Select/Select.esm.js +26 -0
  112. package/src/components/Text/AGENTS.md +32 -0
  113. package/src/components/Text/Text.css +1 -0
  114. package/src/components/Text/Text.d.ts +10 -0
  115. package/src/components/Text/Text.scss +80 -0
  116. package/src/components/Text/Text2.esm.js +23 -0
  117. package/src/components/Textarea/AGENTS.md +32 -0
  118. package/src/components/Textarea/Textarea.d.ts +3 -0
  119. package/src/components/Textarea/Textarea.esm.js +23 -0
  120. package/src/components/TimePicker/AGENTS.md +42 -0
  121. package/src/components/TimePicker/TimePicker.css +1 -0
  122. package/src/components/TimePicker/TimePicker.d.ts +13 -0
  123. package/src/components/TimePicker/TimePicker.scss +226 -0
  124. package/src/components/TimePicker/TimePicker2.esm.js +98 -0
  125. package/src/components/TimePicker/TimePickerDisplay.d.ts +16 -0
  126. package/src/components/TimePicker/TimePickerDisplay.esm.js +54 -0
  127. package/src/components/TimePicker/TimePickerWheel.d.ts +13 -0
  128. package/src/components/TimePicker/TimePickerWheel.esm.js +61 -0
  129. package/src/components/TimePicker/constants.d.ts +7 -0
  130. package/src/components/TimePicker/constants.esm.js +3 -0
  131. package/src/components/TimePicker/utilities.d.ts +15 -0
  132. package/src/components/TimePicker/utilities.esm.js +20 -0
  133. package/src/components/Tooltip/AGENTS.md +41 -0
  134. package/src/components/Tooltip/Tooltip.css +1 -0
  135. package/src/components/Tooltip/Tooltip.d.ts +12 -0
  136. package/src/components/Tooltip/Tooltip.scss +29 -0
  137. package/src/components/Tooltip/Tooltip2.esm.js +65 -0
  138. package/src/components/index.d.ts +20 -7
  139. package/src/stories/assets/Stam.jpg +0 -0
  140. package/src/stories/assets/kaluah.jpg +0 -0
  141. package/src/stories/assets/stam2.jpg +0 -0
  142. package/src/stories/assets/tito.jpg +0 -0
  143. package/src/stories/documentation/AboutUs.mdx +21 -0
  144. package/src/stories/documentation/GettingStarted.mdx +117 -0
  145. package/src/stories/documentation/Introduction.mdx +29 -0
  146. package/src/stories/documentation/Themes.mdx +264 -0
  147. package/src/stories/documentation/ToDo.mdx +17 -0
  148. package/src/stories/molecules/Carousel.scss +21 -0
  149. package/src/stories/utilities/DeviceDetection.mdx +59 -0
  150. package/src/styles/_config.scss +30 -0
  151. package/src/styles/components/ThemeProvider.esm.js +1 -1
  152. package/src/styles/global/components/_button.scss +57 -52
  153. package/src/styles/global/components/_checkbox.scss +63 -59
  154. package/src/styles/global/components/_code.scss +19 -15
  155. package/src/styles/global/components/_input.scss +29 -37
  156. package/src/styles/global/components/_radioButton.scss +29 -26
  157. package/src/styles/global/components/_select.scss +56 -0
  158. package/src/styles/global/components/_typography.scss +92 -6
  159. package/src/styles/global/globalStyles.module.scss +1 -129
  160. package/src/styles/global/globalStyles.scss +85 -1
  161. package/src/styles/index.d.ts +1 -1
  162. package/src/styles/theme/components.esm.js +11 -7
  163. package/src/styles/theme/theme.esm.js +31 -41
  164. package/src/styles/theme/types.d.ts +4 -1
  165. package/src/styles/utilities/_functions.scss +117 -0
  166. package/src/styles/utilities/_mixins.scss +0 -0
  167. package/src/styles/utilities/_placeholders.scss +6 -0
  168. package/src/styles/utilities/color.d.ts +1 -1
  169. package/src/styles/utilities/constants.d.ts +1 -1
  170. package/src/styles/utilities/layout.d.ts +1 -1
  171. package/src/styles/utilities/layout.esm.js +3 -3
  172. package/src/{styles/utilities → utilities}/types.d.ts +53 -3
  173. package/src/utilities/types.esm.js +79 -0
  174. package/src/utilities/validations.d.ts +5 -0
  175. package/src/utilities/validations.esm.js +19 -1
  176. package/src/components/Button.esm.js +0 -28
  177. package/src/components/Button.module.css +0 -1
  178. package/src/components/Button.module.esm.js +0 -9
  179. package/src/components/Button.module.scss +0 -5
  180. package/src/components/Checkbox.d.ts +0 -7
  181. package/src/components/Input.d.ts +0 -11
  182. package/src/components/Input.esm.js +0 -41
  183. package/src/components/Input.module.css +0 -1
  184. package/src/components/Input.module.esm.js +0 -11
  185. package/src/components/Input.module.scss +0 -141
  186. package/src/components/InputPassword.esm.js +0 -33
  187. package/src/components/Loader.esm.js +0 -21
  188. package/src/components/Modal.esm.js +0 -62
  189. package/src/components/Modal.module.css +0 -1
  190. package/src/components/Modal.module.esm.js +0 -13
  191. package/src/components/Modal.module.scss +0 -133
  192. package/src/components/RadioButton.d.ts +0 -7
  193. package/src/styles/global/components/_mixins.scss +0 -2
  194. package/src/styles/global/components/button.d.ts +0 -7
  195. package/src/styles/global/components/loaders.module.css +0 -1
  196. package/src/styles/global/components/loaders.module.esm.js +0 -21
  197. package/src/styles/utilities/types.esm.js +0 -54
  198. package/src/{styles/global/components/loaders.d.ts → components/Loader/types.d.ts} +1 -1
  199. /package/src/{styles/global/components/loaders.esm.js → components/Loader/types.esm.js} +0 -0
  200. /package/src/components/{Progress.d.ts → Progress/Progress.d.ts} +0 -0
@@ -0,0 +1,226 @@
1
+ @use "../../styles/utilities/_functions" as u;
2
+ @use "../../styles/global/components/input";
3
+ @use "../../styles/utilities/_placeholders";
4
+ @use "../DatePicker/_DatePicker";
5
+
6
+ @layer craftsman-component {
7
+ .react-time-picker,
8
+ .react-time-picker *,
9
+ .react-time-picker *:before,
10
+ .react-time-picker *:after {
11
+ @extend %border-box;
12
+ }
13
+
14
+ .react-time-picker {
15
+ @extend %date-picker-styles;
16
+ &--disabled {
17
+ @extend %date-picker-disabled;
18
+ }
19
+ &__wrapper {
20
+ @extend %date-picker-wrapper;
21
+ padding: 6px 24px 6px 8px;
22
+ }
23
+ &__inputGroup {
24
+ @extend %date-picker-input-group;
25
+ }
26
+ &__inputGroup__divider {
27
+ @extend %date-picker-divider;
28
+ }
29
+ &__inputGroup__divider,
30
+ &__inputGroup__leadingZero {
31
+ @extend %date-picker-leading-zero-divider;
32
+ }
33
+ &__inputGroup__input {
34
+ @extend %date-picker-group-input;
35
+ }
36
+ &__inputGroup__input::-webkit-outer-spin-button,
37
+ &__inputGroup__input::-webkit-inner-spin-button {
38
+ @extend %date-picker-input-spinner;
39
+ }
40
+ &__inputGroup__input--hasLeadingZero {
41
+ @extend %date-picker-input-leading-zero;
42
+ }
43
+ &__button {
44
+ @extend %date-picker-button;
45
+ }
46
+ }
47
+
48
+ .react-time-picker__inputGroup__input:invalid {
49
+ background: rgba(255, 0, 0, 0.1);
50
+ }
51
+
52
+ .react-time-picker__inputGroup__amPm {
53
+ font: inherit;
54
+ -webkit-appearance: menulist;
55
+ -moz-appearance: menulist;
56
+ appearance: menulist;
57
+ }
58
+
59
+ .react-time-picker__button:enabled {
60
+ cursor: pointer;
61
+ }
62
+
63
+ .react-time-picker__button:enabled:hover .react-time-picker__button__icon,
64
+ .react-time-picker__button:enabled:focus .react-time-picker__button__icon {
65
+ stroke: #0078d7;
66
+ }
67
+
68
+ .react-time-picker__button:disabled .react-time-picker__button__icon {
69
+ stroke: #6d6d6d;
70
+ }
71
+
72
+ .react-time-picker__button svg {
73
+ display: inherit;
74
+ }
75
+
76
+ .react-time-picker__clock {
77
+ width: 200px;
78
+ height: 200px;
79
+ max-width: 100vw;
80
+ padding: 25px;
81
+ background-color: white;
82
+ border: thin solid #a0a096;
83
+ z-index: 1;
84
+ }
85
+
86
+ .react-time-picker__clock--closed {
87
+ display: none;
88
+ }
89
+
90
+ .timePicker {
91
+ // suppress the built-in clock popup — our custom wheel renders instead
92
+ .react-time-picker__clock {
93
+ display: none;
94
+ }
95
+
96
+ .timePicker__field {
97
+ position: relative;
98
+
99
+ .input-view-toggle {
100
+ position: absolute;
101
+ right: 4px;
102
+ top: 50%;
103
+ transform: translateY(-50%);
104
+ padding: 4px;
105
+ line-height: 1;
106
+ }
107
+ }
108
+
109
+ &__display {
110
+ position: relative;
111
+ display: inline-flex;
112
+ height: 160px;
113
+ background-color: #{u.color("white")};
114
+ border: 1px solid #{u.color("gray400")};
115
+ border-radius: 8px;
116
+ z-index: 1;
117
+ &:before,
118
+ &:after {
119
+ position: absolute;
120
+ left: 0;
121
+ right: 0;
122
+ content: "";
123
+ display: block;
124
+ height: calc(50% - 32px / 2);
125
+ z-index: 1;
126
+ pointer-events: none;
127
+ }
128
+
129
+ &:before {
130
+ top: -0.5px;
131
+ border-bottom: 0.5px solid rgba(var(--text-high-contrast-rgb-value), 0.3);
132
+ background: linear-gradient(
133
+ to top,
134
+ rgba(var(--background-site-rgb-value), 0.65) 0%,
135
+ rgba(var(--background-site-rgb-value), 1) 100%
136
+ );
137
+ }
138
+
139
+ &:after {
140
+ bottom: -0.5px;
141
+ border-top: 0.5px solid rgba(var(--text-high-contrast-rgb-value), 0.3);
142
+ background: linear-gradient(
143
+ to bottom,
144
+ rgba(var(--background-site-rgb-value), 0.65) 0%,
145
+ rgba(var(--background-site-rgb-value), 1) 100%
146
+ );
147
+ }
148
+
149
+ .ios-picker {
150
+ height: 100%;
151
+ display: flex;
152
+ flex-direction: row;
153
+ align-items: center;
154
+ gap: 6px;
155
+ padding: 0 12px;
156
+ line-height: 1;
157
+ font-size: 16px;
158
+
159
+ &--disabled {
160
+ pointer-events: none;
161
+ opacity: 0.5;
162
+ }
163
+ }
164
+
165
+ .ios-picker__scene {
166
+ min-width: 30px;
167
+ height: 100%;
168
+ overflow: hidden;
169
+ display: flex;
170
+ align-items: center;
171
+ touch-action: pan-x;
172
+ }
173
+
174
+ .ios-picker__viewport {
175
+ height: 32px;
176
+ width: 100%;
177
+ perspective: 1000px;
178
+ -webkit-user-select: none;
179
+ -moz-user-select: none;
180
+ -ms-user-select: none;
181
+ user-select: none;
182
+ -webkit-touch-callout: none;
183
+ -khtml-user-select: none;
184
+ -webkit-tap-highlight-color: transparent;
185
+ }
186
+
187
+ .ios-picker__viewport--perspective-left {
188
+ perspective-origin: calc(50% + 130px) 50%;
189
+ transform: translateX(27px);
190
+ }
191
+
192
+ .ios-picker__viewport--perspective-right {
193
+ perspective-origin: calc(50% - 130px) 50%;
194
+ transform: translateX(-27px);
195
+ }
196
+
197
+ .ios-picker__viewport--perspective-center {
198
+ perspective-origin: 50% 50%;
199
+ }
200
+
201
+ .ios-picker__container {
202
+ height: 100%;
203
+ width: 100%;
204
+ transform-style: preserve-3d;
205
+ will-change: transform;
206
+ }
207
+
208
+ .ios-picker__slide {
209
+ width: 100%;
210
+ height: 100%;
211
+ text-align: center;
212
+ display: flex;
213
+ align-items: center;
214
+ justify-content: center;
215
+ backface-visibility: hidden;
216
+ opacity: 0;
217
+ }
218
+
219
+ .ios-picker__label {
220
+ font-weight: 700;
221
+ white-space: nowrap;
222
+ pointer-events: none;
223
+ }
224
+ }
225
+ }
226
+ }
@@ -0,0 +1,98 @@
1
+ "use client";
2
+ import { Button as e } from "../Button/Button.esm.js";
3
+ import { InputWrapper as t } from "../Input/InputWrapper.esm.js";
4
+ import './TimePicker.css';/* empty css */
5
+ import { resolveLocale as n } from "./utilities.esm.js";
6
+ import { TimePickerDisplay as r } from "./TimePickerDisplay.esm.js";
7
+ import { require_lib as i } from "../../../node_modules/react-device-detect/dist/lib.esm.js";
8
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
9
+ import { useEffect as s, useState as c } from "react";
10
+ import { FaClock as l, FaRegClock as u, FaX as d } from "react-icons/fa6";
11
+ import { autoUpdate as f, flip as p, offset as m, shift as h, useFloating as g } from "@floating-ui/react-dom";
12
+ import { TimePicker as _ } from "react-time-picker";
13
+ //#region src/components/TimePicker/TimePicker.tsx
14
+ var v = i(), y = (i) => {
15
+ let { labels: y, locale: b, format: x, value: S, onChange: C, label: w, labelPosition: T, error: E, required: D, name: O, ...k } = i, [A, j] = c(null), [M, N] = c(null), { floatingStyles: P } = g({
16
+ placement: "bottom-start",
17
+ strategy: "absolute",
18
+ whileElementsMounted: f,
19
+ middleware: [
20
+ m(4),
21
+ p(),
22
+ h()
23
+ ],
24
+ elements: {
25
+ reference: A,
26
+ floating: M
27
+ }
28
+ }), [F, I] = c(!1), L = n(b);
29
+ return s(() => {
30
+ if (!F) return;
31
+ let e = (e) => {
32
+ A?.contains(e.target) || M?.contains(e.target) || I(!1);
33
+ };
34
+ return document.addEventListener("pointerdown", e), () => {
35
+ document.removeEventListener("pointerdown", e);
36
+ };
37
+ }, [
38
+ F,
39
+ A,
40
+ M
41
+ ]), /* @__PURE__ */ o("div", {
42
+ className: "timePicker",
43
+ ref: j,
44
+ onFocus: (e) => {
45
+ v.isMobile || e.target instanceof HTMLInputElement && I(!0);
46
+ },
47
+ onKeyDown: (e) => {
48
+ e.key === "Enter" && I(!1);
49
+ },
50
+ children: [
51
+ O && /* @__PURE__ */ a("input", {
52
+ type: "hidden",
53
+ name: O,
54
+ value: typeof S == "string" ? S : "",
55
+ readOnly: !0
56
+ }),
57
+ /* @__PURE__ */ a(t, {
58
+ label: w,
59
+ labelPosition: T,
60
+ error: E,
61
+ required: D,
62
+ children: /* @__PURE__ */ o("div", {
63
+ className: "timePicker__field",
64
+ children: [/* @__PURE__ */ a(_, {
65
+ ...k,
66
+ value: S,
67
+ onChange: C,
68
+ locale: L,
69
+ required: D,
70
+ disableClock: !0,
71
+ clearIcon: /* @__PURE__ */ a(d, { size: 14 })
72
+ }), !v.isMobile && /* @__PURE__ */ a(e, {
73
+ type: "button",
74
+ variant: "text",
75
+ onClick: () => I((e) => !e),
76
+ "aria-label": F ? "Hide time picker" : "Show time picker",
77
+ "aria-pressed": F,
78
+ disabled: i.disabled,
79
+ className: "input-view-toggle",
80
+ children: a(F ? l : u, { size: 16 })
81
+ })]
82
+ })
83
+ }),
84
+ !v.isMobile && /* @__PURE__ */ a(r, {
85
+ value: S,
86
+ onChange: (e) => C?.(e),
87
+ locale: L,
88
+ labels: y,
89
+ format: x,
90
+ visible: F,
91
+ floatingRef: N,
92
+ style: P
93
+ })
94
+ ]
95
+ });
96
+ };
97
+ //#endregion
98
+ export { y as TimePicker };
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ type TimePickerDisplayProps = {
3
+ value?: unknown;
4
+ onChange?: (val: string) => void;
5
+ locale?: Intl.LocalesArgument;
6
+ format?: 24 | 12;
7
+ labels?: {
8
+ hour?: string;
9
+ minute?: string;
10
+ };
11
+ visible?: boolean;
12
+ floatingRef?: (node: HTMLElement | null) => void;
13
+ style?: React.CSSProperties;
14
+ };
15
+ export declare const TimePickerDisplay: React.FC<TimePickerDisplayProps>;
16
+ export {};
@@ -0,0 +1,54 @@
1
+ import { getAmPmLabels as e, getUnitLabel as t, is24HourFormat as n, isEmpty as r } from "../../utilities/validations.esm.js";
2
+ import { padTime as i, parseTimeString as a, resolveLocale as o, resolveTimeFormat as s, to24Hour as c } from "./utilities.esm.js";
3
+ import { IosPickerItem as l } from "./TimePickerWheel.esm.js";
4
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
5
+ import "react";
6
+ //#region src/components/TimePicker/TimePickerDisplay.tsx
7
+ var f = (e, t) => e ? t : void 0, p = (p) => {
8
+ let { value: m, onChange: h, locale: g, format: _, labels: v, visible: y = !1, floatingRef: b, style: x } = p, S = o(g), [C, w] = a(m), T = !r(m), E = s(_, n(S)), D = +(E === 12), O = E === 12 ? e(S) : null, k = +(C >= 12), A = E === 12 ? (C % 12 + 11) % 12 : C;
9
+ return y ? /* @__PURE__ */ d("div", {
10
+ className: "timePicker__display",
11
+ ref: b,
12
+ style: x,
13
+ children: [
14
+ /* @__PURE__ */ u(l, {
15
+ slideCount: E,
16
+ perspective: "left",
17
+ loop: !0,
18
+ offset: D,
19
+ selectedIndex: f(T, A),
20
+ onSelect: (e) => {
21
+ let t = c(e + D, C >= 12, E === 12);
22
+ h?.(`${i(t)}:${i(w)}`);
23
+ },
24
+ label: t(S, "hour", v?.hour)
25
+ }),
26
+ /* @__PURE__ */ u(l, {
27
+ slideCount: 60,
28
+ perspective: "right",
29
+ loop: !0,
30
+ selectedIndex: f(T, w),
31
+ onSelect: (e) => {
32
+ h?.(`${i(C)}:${i(e)}`);
33
+ },
34
+ label: t(S, "minute", v?.minute)
35
+ }),
36
+ E === 12 && O && /* @__PURE__ */ u(l, {
37
+ slideCount: 2,
38
+ perspective: "center",
39
+ loop: !1,
40
+ slides: O,
41
+ selectedIndex: f(T, k),
42
+ onSelect: (e) => {
43
+ let t = e === 1;
44
+ if (t === C >= 12) return;
45
+ let n = t ? C + 12 : C - 12;
46
+ h?.(`${i(n)}:${i(w)}`);
47
+ },
48
+ label: ""
49
+ })
50
+ ]
51
+ }) : null;
52
+ };
53
+ //#endregion
54
+ export { p as TimePickerDisplay };
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ export type IosPickerItemProps = {
3
+ loop?: boolean;
4
+ label: string;
5
+ slideCount: number;
6
+ perspective: "left" | "right" | "center";
7
+ offset?: number;
8
+ slides?: React.ReactNode[];
9
+ selectedIndex?: number;
10
+ onSelect?: (index: number) => void;
11
+ disabled?: boolean;
12
+ };
13
+ export declare const IosPickerItem: (props: IosPickerItemProps) => React.JSX.Element;
@@ -0,0 +1,61 @@
1
+ "use client";
2
+ import e from "../../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.esm.js";
3
+ import "./constants.esm.js";
4
+ import { inactivateEmblaTransform as t, setContainerStyles as n, setSlideStyles as r, snapOnPointerUp as i } from "./utilities.esm.js";
5
+ import a from "clsx";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ import { useCallback as c, useEffect as l, useLayoutEffect as u, useRef as d } from "react";
8
+ //#region src/components/TimePicker/TimePickerWheel.tsx
9
+ var f = (f) => {
10
+ let { slideCount: p, perspective: m, label: h, loop: g = !1, offset: _ = 0, slides: v, selectedIndex: y, onSelect: b, disabled: x } = f, [S, C] = e({
11
+ loop: g,
12
+ axis: "y",
13
+ dragFree: !0,
14
+ containScroll: !1
15
+ }), w = d(null), T = d(b);
16
+ u(() => {
17
+ T.current = b;
18
+ });
19
+ let E = p * 20, D = g ? 0 : 20, O = c((e) => {
20
+ n(e, (p * 20 - D) * e.scrollProgress()), e.slideNodes().forEach((t, n) => {
21
+ r(e, n, g, p, E);
22
+ });
23
+ }, [
24
+ g,
25
+ p,
26
+ D,
27
+ E
28
+ ]);
29
+ return l(() => {
30
+ if (!C) return () => {};
31
+ let e = (e) => T.current?.(e.selectedScrollSnap());
32
+ return C.on("pointerUp", i), C.on("scroll", O), C.on("reInit", t), C.on("reInit", O), C.on("select", e), t(C), O(C), () => {
33
+ C.off("pointerUp", i), C.off("scroll", O), C.off("reInit", t), C.off("reInit", O), C.off("select", e);
34
+ };
35
+ }, [C, O]), l(() => {
36
+ !C || y === void 0 || C.selectedScrollSnap() !== y && C.scrollTo(y);
37
+ }, [C, y]), /* @__PURE__ */ s("div", {
38
+ className: a("ios-picker", { "ios-picker--disabled": x }),
39
+ "aria-disabled": x,
40
+ children: [/* @__PURE__ */ o("div", {
41
+ className: "ios-picker__scene",
42
+ ref: w,
43
+ children: /* @__PURE__ */ o("div", {
44
+ className: `ios-picker__viewport ios-picker__viewport--perspective-${m}`,
45
+ ref: S,
46
+ children: /* @__PURE__ */ o("div", {
47
+ className: "ios-picker__container",
48
+ children: Array.from({ length: p }, (e, t) => /* @__PURE__ */ o("div", {
49
+ className: "ios-picker__slide",
50
+ children: v ? v[t] : t + _
51
+ }, t))
52
+ })
53
+ })
54
+ }), /* @__PURE__ */ o("div", {
55
+ className: "ios-picker__label",
56
+ children: h
57
+ })]
58
+ });
59
+ };
60
+ //#endregion
61
+ export { f as IosPickerItem };
@@ -0,0 +1,7 @@
1
+ export declare const CIRCLE_DEGREES = 360;
2
+ export declare const WHEEL_ITEM_SIZE = 32;
3
+ export declare const WHEEL_ITEM_COUNT = 18;
4
+ export declare const WHEEL_ITEMS_IN_VIEW = 4;
5
+ export declare const WHEEL_ITEM_RADIUS: number;
6
+ export declare const IN_VIEW_DEGREES: number;
7
+ export declare const WHEEL_RADIUS: number;
@@ -0,0 +1,3 @@
1
+ var e = Math.round(32 / 2 / Math.tan(Math.PI / 18));
2
+ //#endregion
3
+ export { e as WHEEL_RADIUS };
@@ -0,0 +1,15 @@
1
+ import { EmblaCarouselType } from 'embla-carousel';
2
+ export declare const parseTimeString: (val: unknown) => [number, number];
3
+ export declare const padTime: (n: number) => string;
4
+ export declare const toDisplayHour: (hours: number, is12h: boolean) => number;
5
+ export declare const to24Hour: (display: number, isPM: boolean, is12h: boolean) => number;
6
+ export declare const resolveLocale: (locale?: Intl.LocalesArgument) => string;
7
+ export declare const resolveTimeFormat: (format: 24 | 12 | undefined, is24h: boolean) => 24 | 12;
8
+ export declare const isInView: (wheelLocation: number, slidePosition: number) => boolean;
9
+ export declare const setSlideStyles: (emblaApi: EmblaCarouselType, index: number, loop: boolean, slideCount: number, totalRadius: number) => void;
10
+ export declare const setContainerStyles: (emblaApi: EmblaCarouselType, wheelRotation: number) => void;
11
+ export declare const inactivateEmblaTransform: (emblaApi: EmblaCarouselType) => void;
12
+ export declare const snapOnPointerUp: (emblaApi: EmblaCarouselType) => void;
13
+ export declare const resolveHasValue: (value: React.ComponentProps<"input">["value"], internalHours: number | null) => boolean;
14
+ export declare const resolveTime: (value: unknown, h: number | null, m: number | null) => [number, number];
15
+ export declare const toDisplayInputValue: (hasVal: boolean, val: string | number) => string;
@@ -0,0 +1,20 @@
1
+ import { WHEEL_RADIUS as e } from "./constants.esm.js";
2
+ //#region src/components/TimePicker/utilities.ts
3
+ var t = (e) => {
4
+ if (typeof e != "string" || !e.includes(":")) return [0, 0];
5
+ let [t, n] = e.split(":").map(Number);
6
+ return [isNaN(t) ? 0 : t, isNaN(n) ? 0 : n];
7
+ }, n = (e) => String(e).padStart(2, "0"), r = (e, t, n) => n ? e === 12 ? t ? 12 : 0 : t ? e + 12 : e : e, i = (e) => e ? String(Array.isArray(e) ? e[0] : e) : typeof navigator < "u" ? navigator.language : "en-US", a = (e, t) => e ?? (t ? 24 : 12), o = (e, t) => Math.abs(e - t) < 80, s = (t, n, r, i, a) => {
8
+ let s = t.slideNodes()[n], c = t.scrollProgress() * a, l = t.scrollSnapList()[n] * a, u = l + a, d = l - a, f = !1, p = n * -20;
9
+ o(c, l) && (f = !0), r && o(c, d) && (f = !0, p = -360 + (i - n) * 20), r && o(c, u) && (f = !0, p = -(a % 360) - n * 20), f ? (s.style.opacity = "1", s.style.transform = `translateY(-${n * 100}%) rotateX(${p}deg) translateZ(${e}px)`) : (s.style.opacity = "0", s.style.transform = "none");
10
+ }, c = (t, n) => {
11
+ t.containerNode().style.transform = `translateZ(${e}px) rotateX(${n}deg)`;
12
+ }, l = (e) => {
13
+ let { translate: t } = e.internalEngine();
14
+ t.clear(), t.toggleActive(!1);
15
+ }, u = (e) => {
16
+ let { scrollTo: t, target: n, location: r } = e.internalEngine(), i = n.get() - r.get(), a = Math.abs(i) < 32 / 2.5 ? 10 : .1;
17
+ t.distance(i * a, !0);
18
+ };
19
+ //#endregion
20
+ export { l as inactivateEmblaTransform, o as isInView, n as padTime, t as parseTimeString, i as resolveLocale, a as resolveTimeFormat, c as setContainerStyles, s as setSlideStyles, u as snapOnPointerUp, r as to24Hour };
@@ -0,0 +1,41 @@
1
+ # Tooltip — Agent Usage Notes
2
+
3
+ > Not yet part of the documented public export surface (see `craftsman-component-usage` skill's Known Limitations). Source path only — do not assume `@stamcat/craftsman/Tooltip` is published until confirmed in `exports.ts`.
4
+
5
+ Import (source-relative, once exported):
6
+
7
+ ```tsx
8
+ import { Tooltip } from "@stamcat/craftsman/Tooltip";
9
+ ```
10
+
11
+ Props:
12
+
13
+ - `anchor: React.ReactNode` — the element the tooltip is attached to.
14
+ - `content: React.ReactNode` — the floating content shown.
15
+ - `placement?: Placement` (from `@floating-ui/react-dom`, default: `"bottom-start"`)
16
+ - `strategy?: Strategy` (from `@floating-ui/react-dom`, default: `"absolute"`)
17
+ - `showContent?: "hover" | "click"` (default: `"hover"`)
18
+ - `anchorStyles?: React.CSSProperties`
19
+ - `contentStyles?: React.CSSProperties`
20
+
21
+ Behavior notes:
22
+
23
+ - Built on `@floating-ui/react-dom`'s `useFloating` with `autoUpdate` and `offset(12)`, `flip()`, `shift()` middleware.
24
+ - `showContent="hover"` toggles visibility on the anchor's `mouseenter`/`mouseleave`.
25
+ - `showContent="click"` toggles visibility on anchor click, and closes on any outside `pointerdown`.
26
+ - Floating content is only rendered in the DOM while visible (not just hidden via CSS).
27
+ - Current `placement` is exposed via `data-placement` on the floating element for style targeting.
28
+
29
+ Example:
30
+
31
+ ```tsx
32
+ <Tooltip
33
+ anchor={<Button variant="text">Hover me</Button>}
34
+ content="Helpful detail"
35
+ placement="top"
36
+ />
37
+ ```
38
+
39
+ Implementation caution:
40
+
41
+ - No dedicated theme entry currently in `theme.components`; style via `anchorStyles`/`contentStyles` or global selectors targeting `.tooltip__anchor` / `.tooltip__floating`.
@@ -0,0 +1 @@
1
+ @layer craftsman-component{.tooltip{--tooltip-bg:var(--gray800)}.tooltip__floating{background-color:var(--tooltip-bg);color:var(--white);padding:calc(var(--w-gutter) * .25) calc(var(--w-gutter) * .5);border-radius:6px;position:relative}.tooltip__floating:before{content:"";background-color:var(--tooltip-bg);width:8px;height:8px;position:absolute;transform:rotate(45deg)}.tooltip__floating[data-placement^=bottom]:before{margin-left:-4px;top:-4px;left:50%}.tooltip__floating[data-placement^=top]:before{margin-left:-4px;bottom:-4px;left:50%}.tooltip__floating[data-placement^=left]:before{margin-top:-4px;top:50%;right:-4px}.tooltip__floating[data-placement^=right]:before{margin-top:-4px;top:50%;left:-4px}}
@@ -0,0 +1,12 @@
1
+ import { Placement, Strategy } from '@floating-ui/react-dom';
2
+ import { default as React } from 'react';
3
+ export type TooltipProps = {
4
+ anchor: React.ReactNode;
5
+ content: React.ReactNode;
6
+ placement?: Placement;
7
+ strategy?: Strategy;
8
+ showContent?: "hover" | "click";
9
+ anchorStyles?: React.CSSProperties;
10
+ contentStyles?: React.CSSProperties;
11
+ };
12
+ export declare const Tooltip: React.FC<TooltipProps>;
@@ -0,0 +1,29 @@
1
+ @use "../../styles/utilities/_functions" as u;
2
+
3
+ @layer craftsman-component {
4
+ .tooltip {
5
+ --tooltip-bg: #{u.color("gray800")};
6
+
7
+ &__floating {
8
+ position: relative;
9
+ background-color: var(--tooltip-bg);
10
+ color: #{u.color("white")};
11
+ padding: #{u.width("gutter", 0.25)} #{u.width("gutter", 0.5)};
12
+ border-radius: 6px;
13
+
14
+ &::before {
15
+ content: '';
16
+ position: absolute;
17
+ width: 8px;
18
+ height: 8px;
19
+ background-color: var(--tooltip-bg);
20
+ transform: rotate(45deg);
21
+ }
22
+
23
+ &[data-placement^="bottom"]::before { top: -4px; left: 50%; margin-left: -4px; }
24
+ &[data-placement^="top"]::before { bottom: -4px; left: 50%; margin-left: -4px; }
25
+ &[data-placement^="left"]::before { right: -4px; top: 50%; margin-top: -4px; }
26
+ &[data-placement^="right"]::before { left: -4px; top: 50%; margin-top: -4px; }
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import './Tooltip.css';/* empty css */
3
+ import e from "clsx";
4
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
+ import { useEffect as r, useState as i } from "react";
6
+ import { autoUpdate as a, flip as o, offset as s, shift as c, useFloating as l } from "@floating-ui/react-dom";
7
+ //#region src/components/Tooltip/Tooltip.tsx
8
+ var u = (u) => {
9
+ let { showContent: d = "hover" } = u, [f, p] = i(null), [m, h] = i(null), { floatingStyles: g, placement: _ } = l({
10
+ placement: u.placement ?? "bottom-start",
11
+ strategy: u.strategy ?? "absolute",
12
+ whileElementsMounted: a,
13
+ middleware: [
14
+ s(12),
15
+ o(),
16
+ c()
17
+ ],
18
+ elements: {
19
+ reference: f,
20
+ floating: m
21
+ }
22
+ }), [v, y] = i(!1);
23
+ return r(() => {
24
+ if (!v || d !== "click") return;
25
+ let e = (e) => {
26
+ f?.contains(e.target) || m?.contains(e.target) || y(!1);
27
+ };
28
+ return document.addEventListener("pointerdown", e), () => {
29
+ document.removeEventListener("pointerdown", e);
30
+ };
31
+ }, [
32
+ v,
33
+ d,
34
+ f,
35
+ m
36
+ ]), /* @__PURE__ */ n("div", {
37
+ className: e("tooltip"),
38
+ children: [/* @__PURE__ */ t("div", {
39
+ className: e("tooltip__anchor"),
40
+ ref: p,
41
+ onMouseEnter: () => {
42
+ d === "hover" && y(!0);
43
+ },
44
+ onMouseLeave: () => {
45
+ d === "hover" && y(!1);
46
+ },
47
+ onClick: () => {
48
+ d === "click" && y((e) => !e);
49
+ },
50
+ style: u.anchorStyles,
51
+ children: u.anchor
52
+ }), v && /* @__PURE__ */ t("div", {
53
+ className: e("tooltip__floating"),
54
+ ref: h,
55
+ "data-placement": _,
56
+ style: {
57
+ ...g,
58
+ ...u.contentStyles
59
+ },
60
+ children: u.content
61
+ })]
62
+ });
63
+ };
64
+ //#endregion
65
+ export { u as Tooltip };