@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,64 @@
1
+ # Button — Agent Usage Notes
2
+
3
+ Import:
4
+
5
+ ```tsx
6
+ import { Button } from "@stamcat/craftsman/Button";
7
+ ```
8
+
9
+ Props:
10
+
11
+ - Inherits all native `<button>` props.
12
+ - `variant?: "primary" | "default" | "text"` (default: `"default"`)
13
+ - `size?: number` (default visual scale is `1`)
14
+ - `styles?: React.CSSProperties` (inline style override)
15
+
16
+ Behavior notes:
17
+
18
+ - `type` defaults to `"button"`.
19
+ - For `variant !== "default"`, variant is appended to `className` (for example `"primary"`).
20
+ - `className` is preserved and merged after component classes.
21
+ - Theme component overrides are selector-based CSS emitted by `ThemeProvider`; `theme.components.*` accepts JS style objects or raw CSS/Sass strings for the target selector.
22
+ - If `children` is empty (per `isEmpty`), the component renders nothing.
23
+ - `size` is clamped to `[0.1, 10]` before styling is applied.
24
+ - When `size` is provided, Button scales:
25
+ - `border-radius: calc(var(--btn-border-radius) * size)`
26
+ - `padding: calc(var(--btn-pad-y) * size) calc(var(--btn-pad-x) * size)`
27
+ - `font-size: max(10px, calc(var(--w-text) * size))`
28
+ - There is no dedicated icon/loading prop. Icons, loaders, and mixed content are passed as `children`.
29
+ - Supports both real disable (`disabled={true}`) and style-only disable (`className="disabled"`).
30
+ - Native button modes are supported (`type="button" | "submit" | "reset"`).
31
+ - Accessibility props such as `aria-label` pass through unchanged.
32
+
33
+ Example:
34
+
35
+ ```tsx
36
+ <Button variant="primary" onClick={onSave}>Save</Button>
37
+ ```
38
+
39
+ Story-aligned usage examples:
40
+
41
+ ```tsx
42
+ // Scaled compact button (size is clamped to [0.1, 10])
43
+ <Button variant="primary" size={0.5}>Mini Action</Button>
44
+
45
+ // Icon content
46
+ <Button variant="primary">
47
+ <TruckIcon size={20} /> <span>Ship</span>
48
+ </Button>
49
+
50
+ // Loading content
51
+ <Button aria-label="Saving">
52
+ <Loader type="boxy" width={32} color="#de13ca" />
53
+ </Button>
54
+
55
+ // Style-only disabled appearance while still allowing click handlers
56
+ <Button className="disabled" onClick={onClick}>Disabled Look</Button>
57
+
58
+ // Native submit behavior
59
+ <Button type="submit" aria-label="Save form">Save</Button>
60
+ ```
61
+
62
+ Implementation caution:
63
+
64
+ - Size scaling depends on CSS variables provided by the package global styles (`--btn-border-radius`, `--btn-pad-y`, `--btn-pad-x`, `--w-text`).
@@ -1,4 +1,4 @@
1
- import { ButtonType } from '../styles/global/components/button';
1
+ import { ButtonType } from '../../utilities/types';
2
2
  export type ButtonProps = React.ComponentProps<"button"> & {
3
3
  variant?: ButtonType;
4
4
  size?: number;
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { isEmpty as e } from "../../utilities/validations.esm.js";
3
+ import { width as t } from "../../styles/utilities/layout.esm.js";
4
+ import n from "clsx";
5
+ import { Fragment as r, jsx as i } from "react/jsx-runtime";
6
+ //#region src/components/Button/Button.tsx
7
+ var a = (a) => {
8
+ let { type: o = "button", variant: s = "default", size: c, styles: l, className: u, style: d, ...f } = a, p = typeof c == "number" ? Math.min(10, Math.max(.1, c)) : void 0, m = e(l) ? void 0 : l, h = p ? {
9
+ borderRadius: `calc(var(--btn-border-radius) * ${p})`,
10
+ padding: `calc(var(--btn-pad-y) * ${p}) calc(var(--btn-pad-x) * ${p})`,
11
+ fontSize: `max(10px, calc(${t("text")} * ${p}))`
12
+ } : {};
13
+ return e(a.children) ? /* @__PURE__ */ i(r, {}) : /* @__PURE__ */ i("button", {
14
+ type: o,
15
+ className: n("button", s, u),
16
+ style: {
17
+ ...h,
18
+ ...m,
19
+ ...d
20
+ },
21
+ ...f
22
+ });
23
+ };
24
+ //#endregion
25
+ export { a as Button };
@@ -0,0 +1,41 @@
1
+ # Carousel — Agent Usage Notes
2
+
3
+ Import:
4
+
5
+ ```tsx
6
+ import { Carousel } from "@stamcat/craftsman/Carousel";
7
+ ```
8
+
9
+ Props:
10
+
11
+ - Extends `EmblaOptionsType` from `embla-carousel`, except `slides`.
12
+ - `slides?: React.ReactNode[]`
13
+ - `className?: string`
14
+ - `style?: React.CSSProperties`
15
+ - `buttons?: boolean` (default: `true`)
16
+ - `pagination?: "dots" | "numbers"` (default: `"dots"`)
17
+
18
+ Behavior notes:
19
+
20
+ - `slides` is an array prop; do not pass slide content as `children`.
21
+ - Built on `embla-carousel-react`, so standard Embla options such as `loop`, `align`, `dragFree`, and `slidesToScroll` pass through.
22
+ - Previous/next controls are built in and can be hidden with `buttons={false}`.
23
+ - Pagination can render dots or the shared `Pagination` component in number mode.
24
+ - Number pagination uses zero-based indexes internally, consistent with `Pagination`.
25
+ - The component manages its own selected index from the Embla instance; there is no separate controlled index prop.
26
+
27
+ Example:
28
+
29
+ ```tsx
30
+ const slides = [
31
+ <figure key="one"><img src="/slide-1.jpg" alt="First slide" /></figure>,
32
+ <figure key="two"><img src="/slide-2.jpg" alt="Second slide" /></figure>,
33
+ ];
34
+
35
+ <Carousel
36
+ slides={slides}
37
+ loop={false}
38
+ pagination="dots"
39
+ align="center"
40
+ />
41
+ ```
@@ -0,0 +1 @@
1
+ @layer craftsman-component{.carousel{position:relative}.carousel__viewport{overflow:hidden}.carousel__container{touch-action:pan-y pinch-zoom;display:flex}.carousel__slide{flex:0 0 100%;min-width:0}.carousel__controls{justify-content:space-between;gap:calc(var(--w-gutter) * .5);margin-top:calc(var(--w-gutter) * .75);flex-flow:row;width:100%;display:inline-flex}.carousel__dots button{margin:0 calc(var(--w-gutter) * .125)}}
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { EmblaOptionsType } from 'embla-carousel';
3
+ import { CarouselPageType } from '../../utilities/types';
4
+ export type CarouselProps = Omit<EmblaOptionsType, "slides"> & {
5
+ slides?: React.ReactNode[];
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ buttons?: boolean;
9
+ pagination?: CarouselPageType;
10
+ };
11
+ export declare const Carousel: React.FC<CarouselProps>;
@@ -0,0 +1,34 @@
1
+ @use "../../styles/utilities/_functions" as u;
2
+
3
+ @layer craftsman-component {
4
+ .carousel {
5
+ position: relative;
6
+
7
+ &__viewport {
8
+ overflow: hidden;
9
+ }
10
+
11
+ &__container {
12
+ display: flex;
13
+ touch-action: pan-y pinch-zoom;
14
+ }
15
+
16
+ &__slide {
17
+ flex: 0 0 100%;
18
+ min-width: 0;
19
+ }
20
+
21
+ &__controls {
22
+ display: inline-flex;
23
+ justify-content: space-between;
24
+ flex-flow: row nowrap;
25
+ gap: #{u.width("gutter", 0.5)};
26
+ margin-top: #{u.width("gutter", 0.75)};
27
+ width: 100%;
28
+ }
29
+ &__dots button {
30
+ margin: 0 #{u.width("gutter", 0.125)};
31
+ }
32
+
33
+ }
34
+ }
@@ -0,0 +1,75 @@
1
+ "use client";
2
+ import { Button as e } from "../Button/Button.esm.js";
3
+ import { Pagination as t } from "../Pagination/Pagination2.esm.js";
4
+ import n from "../../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.esm.js";
5
+ import './Carousel.css';/* empty css */
6
+ import r from "clsx";
7
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
8
+ import { useCallback as o, useSyncExternalStore as s } from "react";
9
+ import { FaAngleLeft as c, FaAngleRight as l, FaCircle as u, FaRegCircle as d } from "react-icons/fa6";
10
+ //#region src/components/Carousel/Carousel.tsx
11
+ var f = (f) => {
12
+ let { slides: p = [], className: m, style: h, buttons: g = !0, pagination: _ = "dots", ...v } = f, [y, b] = n(v), x = o((e) => b ? (b.on("select", e).on("reInit", e), () => {
13
+ b.off("select", e), b.off("reInit", e);
14
+ }) : () => {}, [b]), S = s(x, () => !!b?.canScrollPrev(), () => !1), C = s(x, () => !!b?.canScrollNext(), () => !1), w = s(x, () => b?.selectedScrollSnap() ?? 0, () => 0), T = () => b?.scrollPrev(), E = () => b?.scrollNext(), D = (e) => {
15
+ let t = parseInt(e.currentTarget.value, 10) || 0;
16
+ b?.scrollTo(t);
17
+ };
18
+ return /* @__PURE__ */ a("div", {
19
+ className: r("carousel", m),
20
+ style: h,
21
+ children: [/* @__PURE__ */ i("div", {
22
+ className: "carousel__viewport",
23
+ ref: y,
24
+ children: /* @__PURE__ */ i("div", {
25
+ className: "carousel__container",
26
+ children: p.map((e, t) => /* @__PURE__ */ i("div", {
27
+ className: "carousel__slide",
28
+ children: e
29
+ }, `slide-${t}`))
30
+ })
31
+ }), /* @__PURE__ */ a("div", {
32
+ className: "carousel__controls",
33
+ children: [
34
+ g && /* @__PURE__ */ a("div", {
35
+ className: "carousel__buttons",
36
+ children: [/* @__PURE__ */ i(e, {
37
+ variant: "text",
38
+ onClick: T,
39
+ disabled: !S,
40
+ name: "prev",
41
+ children: /* @__PURE__ */ i(c, {
42
+ size: 24,
43
+ "aria-label": "prev"
44
+ })
45
+ }), /* @__PURE__ */ i(e, {
46
+ variant: "text",
47
+ onClick: E,
48
+ disabled: !C,
49
+ name: "next",
50
+ children: /* @__PURE__ */ i(l, {
51
+ size: 24,
52
+ "aria-label": "next"
53
+ })
54
+ })]
55
+ }),
56
+ _ === "dots" && /* @__PURE__ */ i("div", {
57
+ className: "carousel__dots",
58
+ children: p.map((t, n) => /* @__PURE__ */ i(e, {
59
+ variant: "text",
60
+ value: n,
61
+ onClick: D,
62
+ children: i(w === n ? u : d, { size: 16 })
63
+ }, `dot-${n}`))
64
+ }),
65
+ _ === "numbers" && /* @__PURE__ */ i(t, {
66
+ total: p.length,
67
+ current: w,
68
+ onChange: D
69
+ })
70
+ ]
71
+ })]
72
+ });
73
+ };
74
+ //#endregion
75
+ export { f as Carousel };
@@ -0,0 +1,32 @@
1
+ # Checkbox — Agent Usage Notes
2
+
3
+ Import:
4
+
5
+ ```tsx
6
+ import { Checkbox } from "@stamcat/craftsman/Checkbox";
7
+ ```
8
+
9
+ Props:
10
+
11
+ - Extends `Input` props.
12
+ - `type?: "checkbox"` (default: `"checkbox"`)
13
+ - `labelPosition?: "left" | "right" | "top" | "bottom"` (default: `"right"`)
14
+
15
+ Behavior notes:
16
+
17
+ - `Checkbox` is a thin wrapper around `Input` with checkbox-specific guardrails.
18
+ - The wrapper enforces checkbox type by default and narrows label position options to common checkbox layouts.
19
+ - Controlled and uncontrolled patterns are both supported (`checked` + `onChange`, or `defaultChecked`).
20
+
21
+ Example:
22
+
23
+ ```tsx
24
+ <Checkbox
25
+ id="accept-terms"
26
+ name="terms"
27
+ value="accepted"
28
+ label="Accept terms"
29
+ checked={accepted}
30
+ onChange={(event) => setAccepted(event.currentTarget.checked)}
31
+ />
32
+ ```
@@ -0,0 +1,7 @@
1
+ import { InputProps } from '../Input/Input';
2
+ import { CheckboxLabelPosition } from '../../utilities/types';
3
+ export type CheckboxProps = InputProps & {
4
+ type?: "checkbox";
5
+ labelPosition?: CheckboxLabelPosition;
6
+ };
7
+ export declare const Checkbox: React.FC<CheckboxProps>;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { Input as e } from "./Input.esm.js";
2
+ import { Input as e } from "../Input/Input2.esm.js";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
- //#region src/components/Checkbox.tsx
4
+ //#region src/components/Checkbox/Checkbox.tsx
5
5
  var n = ({ type: n = "checkbox", labelPosition: r = "right", ...i }) => /* @__PURE__ */ t(e, {
6
6
  type: n,
7
7
  labelPosition: r,
@@ -0,0 +1,36 @@
1
+ # DatePicker — Agent Usage Notes
2
+
3
+ Import:
4
+
5
+ ```tsx
6
+ import { DatePicker } from "@stamcat/craftsman/DatePicker";
7
+ ```
8
+
9
+ Props:
10
+
11
+ - Extends `DatePickerProps` from `react-date-picker`.
12
+ - `label?: string | ReactNode`
13
+ - `labelPosition?: "top" | "left" | "bottom" | "right" | "inside" | "hidden"` (default: `"top"`)
14
+ - `error?: string | boolean | ReactNode`
15
+ - `required?: boolean`
16
+ - `value?: Date | null`
17
+ - `onChange?: (value: DatePickerProps["value"]) => void`
18
+
19
+ Behavior notes:
20
+
21
+ - Controlled component — parent owns `value` and `onChange`.
22
+ - Calendar flyout renders below the input; ensure the container has at least 400px of vertical space.
23
+ - Use `useState` to manage the selected date value.
24
+
25
+ Example:
26
+
27
+ ```tsx
28
+ const [date, setDate] = useState<Date | null>(null);
29
+
30
+ <DatePicker
31
+ label="Appointment Date"
32
+ value={date}
33
+ onChange={setDate}
34
+ required
35
+ />
36
+ ```
@@ -0,0 +1 @@
1
+ @layer craftsman-base{.react-date-picker__wrapper:focus{box-shadow:none;outline:0}.react-date-picker__wrapper{color:var(--text);border:1px solid var(--gray400);padding:calc(var(--w-gutter) * .5);background-color:var(--white);border-radius:6px}[type=number].react-date-picker__wrapper::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}[type=number].react-date-picker__wrapper::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}[type=number].react-date-picker__wrapper{appearance:textfield}.react-date-picker__wrapper:disabled,.disabled.react-date-picker__wrapper{border-color:var(--gray200);background-color:var(--gray100)}.react-date-picker__calendar{z-index:1;width:350px;max-width:100vw}.react-date-picker__calendar .react-calendar{border-width:thin}.react-date-picker__calendar--closed,.react-date-picker__clock--closed{display:none}.react-date-picker__calendar .react-date-picker__inputGroup__input:invalid{background:unset}}.react-date-picker,.react-date-picker *,.react-date-picker :before,.react-date-picker :after{box-sizing:border-box}@layer craftsman-component{.react-date-picker{display:inline-flex;position:relative}.react-date-picker--disabled{color:#6d6d6d;background-color:#f0f0f0}.react-date-picker__wrapper{flex-grow:1;flex-shrink:0;padding:6px 8px;display:flex}.react-date-picker__inputGroup{box-sizing:content-box;flex-grow:1;padding:0 2px}.react-date-picker__inputGroup__divider{white-space:pre;padding:1px 0}.react-date-picker__inputGroup__divider,.react-date-picker__inputGroup__leadingZero{font:inherit;display:inline-block}.react-date-picker__inputGroup__input{text-align:center;color:currentColor;min-width:calc(2ch + 1px);height:calc(100% - 2px);font:inherit;box-sizing:content-box;appearance:textfield;background:0 0;border:0;padding:1px;position:relative}[name=year].react-date-picker__inputGroup__input{min-width:calc(4ch + 2px)}.react-date-picker__inputGroup__input:disabled{background-color:unset}.react-date-picker__inputGroup__input::-webkit-outer-spin-button{appearance:none;margin:0}.react-date-picker__inputGroup__input::-webkit-inner-spin-button{appearance:none;margin:0}.react-date-picker__inputGroup__input--hasLeadingZero{margin-left:-.54em;padding-left:calc(1px + .54em)}.react-date-picker__button{border:0;padding:4px 4px 4px 7px}.react-date-picker__button:hover{background:0 0}}
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { LabeledInput } from '../Input/InputWrapper';
3
+ import { DatePickerProps as ReactDatePickerProps } from 'react-date-picker';
4
+ export type DatePickerProps = ReactDatePickerProps & LabeledInput & {
5
+ id?: string;
6
+ style?: React.CSSProperties;
7
+ };
8
+ export declare const DatePicker: React.FC<DatePickerProps>;
@@ -0,0 +1,61 @@
1
+ @use "../../styles/global/components/input";
2
+ @use "../../styles/utilities/_functions" as u;
3
+ @use "../../styles/utilities/_placeholders";
4
+ @use "./_DatePicker";
5
+ @layer craftsman-base {
6
+ .react-date-picker,
7
+ .react-date-picker *,
8
+ .react-date-picker *:before,
9
+ .react-date-picker *:after {
10
+ @extend %border-box;
11
+ }
12
+
13
+ .react-date-picker {
14
+ @extend %date-picker-styles;
15
+ &--disabled {
16
+ @extend %date-picker-disabled;
17
+ }
18
+ &__wrapper {
19
+ @extend %date-picker-wrapper;
20
+ }
21
+ &__inputGroup {
22
+ @extend %date-picker-input-group;
23
+ }
24
+ &__inputGroup__divider {
25
+ @extend %date-picker-divider;
26
+ }
27
+ &__inputGroup__divider,
28
+ &__inputGroup__leadingZero {
29
+ @extend %date-picker-leading-zero-divider;
30
+ }
31
+ &__inputGroup__input {
32
+ @extend %date-picker-group-input;
33
+ }
34
+ &__inputGroup__input::-webkit-outer-spin-button,
35
+ &__inputGroup__input::-webkit-inner-spin-button {
36
+ @extend %date-picker-input-spinner;
37
+ }
38
+ &__inputGroup__input--hasLeadingZero {
39
+ @extend %date-picker-input-leading-zero;
40
+ }
41
+ &__button {
42
+ @extend %date-picker-button;
43
+ }
44
+ &__calendar {
45
+ width: 350px;
46
+ max-width: 100vw;
47
+ z-index: 1;
48
+ .react-calendar {
49
+ border-width: thin;
50
+ }
51
+ }
52
+ &__calendar--closed, &__clock--closed {
53
+ display: none;
54
+ }
55
+
56
+ }
57
+ .react-date-picker__calendar
58
+ .react-date-picker__inputGroup__input:invalid {
59
+ background: unset;
60
+ }
61
+ }
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { InputWrapper as e } from "../Input/InputWrapper.esm.js";
3
+ import './ReactCalendar.css';import './DatePicker.css';/* empty css */
4
+ /* empty css */
5
+ import t from "clsx";
6
+ import { jsx as n } from "react/jsx-runtime";
7
+ import { useId as r } from "react";
8
+ import { DatePicker as i } from "react-date-picker";
9
+ import { FaRegCalendar as a, FaX as o } from "react-icons/fa6";
10
+ //#region src/components/DatePicker/DatePicker.tsx
11
+ var s = ({ label: s, id: c, labelPosition: l = "top", required: u = !1, error: d, style: f, className: p, ...m }) => {
12
+ let h = r();
13
+ return /* @__PURE__ */ n(e, {
14
+ id: c || h,
15
+ className: t("datePicker", p),
16
+ label: s,
17
+ labelPosition: l,
18
+ error: d,
19
+ required: u,
20
+ style: f,
21
+ children: /* @__PURE__ */ n(i, {
22
+ calendarIcon: /* @__PURE__ */ n(a, { size: 16 }),
23
+ clearIcon: /* @__PURE__ */ n(o, { size: 14 }),
24
+ ...m
25
+ })
26
+ });
27
+ };
28
+ //#endregion
29
+ export { s as DatePicker };
@@ -0,0 +1 @@
1
+ .react-calendar,.react-calendar *,.react-calendar :before,.react-calendar :after{box-sizing:border-box}@layer craftsman-base{.react-calendar{background:#fff;border:1px solid #a0a096;width:350px;max-width:100%;line-height:1.125em}.react-calendar--doubleView{width:700px}.react-calendar--doubleView .react-calendar__viewContainer{margin:-.5em;display:flex}.react-calendar--doubleView .react-calendar__viewContainer>*{width:50%;margin:.5em}.react-calendar button{border:0;outline:none;margin:0}.react-calendar button:enabled:hover{cursor:pointer}.react-calendar__navigation{height:44px;margin-bottom:1em;display:flex}.react-calendar__navigation button{background:0 0;min-width:44px}.react-calendar__navigation button:disabled{background-color:#f0f0f0}.react-calendar__navigation button:enabled:hover,.react-calendar__navigation button:enabled:focus{background-color:#e6e6e6}.react-calendar__month-view__weekdays{text-align:center;text-transform:uppercase;font:inherit;font-size:.75em;font-weight:700}.react-calendar__month-view__weekdays__weekday{padding:.5em}.react-calendar__month-view__weekNumbers .react-calendar__tile{font:inherit;justify-content:center;align-items:center;font-size:.75em;font-weight:700;display:flex}.react-calendar__month-view__days__day--weekend{color:#d10000}.react-calendar__month-view__days__day--neighboringMonth,.react-calendar__decade-view__years__year--neighboringDecade,.react-calendar__century-view__decades__decade--neighboringCentury{color:#757575}.react-calendar__tile:disabled{color:#ababab;background-color:#f0f0f0}.react-calendar__month-view__days__day--neighboringMonth:disabled,.react-calendar__decade-view__years__year--neighboringDecade:disabled,.react-calendar__century-view__decades__decade--neighboringCentury:disabled{color:#cdcdcd}.react-calendar__tile:enabled:hover,.react-calendar__tile:enabled:focus{background-color:#e6e6e6}.react-calendar__tile--now{background:#ffff76}.react-calendar__tile--now:enabled:hover,.react-calendar__tile--now:enabled:focus{background:#ffffa9}.react-calendar__tile--hasActive{background:#76baff}.react-calendar__tile--hasActive:enabled:hover,.react-calendar__tile--hasActive:enabled:focus{background:#a9d4ff}.react-calendar__tile--active{color:#fff;background:#006edc}.react-calendar__tile--active:enabled:hover,.react-calendar__tile--active:enabled:focus{background:#1087ff}.react-calendar--selectRange .react-calendar__tile--hover{background-color:#e6e6e6}.react-calendar{border-color:var(--gray400)}.react-calendar button{border-radius:unset;justify-content:center;padding:12px 0}.react-calendar__year-view button,.react-calendar__decade-view button,.react-calendar__century-view button{padding:18px 0}}
@@ -0,0 +1,158 @@
1
+ @use "../../styles/utilities/_functions" as u;
2
+ @use "../../styles/utilities/_placeholders";
3
+
4
+ @layer craftsman-base {
5
+ .react-calendar,
6
+ .react-calendar *,
7
+ .react-calendar *:before,
8
+ .react-calendar *:after {
9
+ @extend %border-box;
10
+ }
11
+
12
+ .react-calendar {
13
+ width: 350px;
14
+ max-width: 100%;
15
+ background: white;
16
+ border: 1px solid #a0a096;
17
+ line-height: 1.125em;
18
+ }
19
+
20
+ .react-calendar--doubleView {
21
+ width: 700px;
22
+ }
23
+
24
+ .react-calendar--doubleView .react-calendar__viewContainer {
25
+ display: flex;
26
+ margin: -0.5em;
27
+ }
28
+
29
+ .react-calendar--doubleView .react-calendar__viewContainer > * {
30
+ width: 50%;
31
+ margin: 0.5em;
32
+ }
33
+ .react-calendar button {
34
+ margin: 0;
35
+ border: 0;
36
+ outline: none;
37
+ }
38
+
39
+ .react-calendar button:enabled:hover {
40
+ cursor: pointer;
41
+ }
42
+
43
+ .react-calendar__navigation {
44
+ display: flex;
45
+ height: 44px;
46
+ margin-bottom: 1em;
47
+ }
48
+
49
+ .react-calendar__navigation button {
50
+ min-width: 44px;
51
+ background: none;
52
+ }
53
+
54
+ .react-calendar__navigation button:disabled {
55
+ background-color: #f0f0f0;
56
+ }
57
+
58
+ .react-calendar__navigation button:enabled:hover,
59
+ .react-calendar__navigation button:enabled:focus {
60
+ background-color: #e6e6e6;
61
+ }
62
+
63
+ .react-calendar__month-view__weekdays {
64
+ text-align: center;
65
+ text-transform: uppercase;
66
+ font: inherit;
67
+ font-size: 0.75em;
68
+ font-weight: bold;
69
+ }
70
+
71
+ .react-calendar__month-view__weekdays__weekday {
72
+ padding: 0.5em;
73
+ }
74
+
75
+ .react-calendar__month-view__weekNumbers .react-calendar__tile {
76
+ display: flex;
77
+ align-items: center;
78
+ justify-content: center;
79
+ font: inherit;
80
+ font-size: 0.75em;
81
+ font-weight: bold;
82
+ }
83
+
84
+ .react-calendar__month-view__days__day--weekend {
85
+ color: #d10000;
86
+ }
87
+
88
+ .react-calendar__month-view__days__day--neighboringMonth,
89
+ .react-calendar__decade-view__years__year--neighboringDecade,
90
+ .react-calendar__century-view__decades__decade--neighboringCentury {
91
+ color: #757575;
92
+ }
93
+ .react-calendar__tile:disabled {
94
+ background-color: #f0f0f0;
95
+ color: #ababab;
96
+ }
97
+
98
+ .react-calendar__month-view__days__day--neighboringMonth:disabled,
99
+ .react-calendar__decade-view__years__year--neighboringDecade:disabled,
100
+ .react-calendar__century-view__decades__decade--neighboringCentury:disabled {
101
+ color: #cdcdcd;
102
+ }
103
+
104
+ .react-calendar__tile:enabled:hover,
105
+ .react-calendar__tile:enabled:focus {
106
+ background-color: #e6e6e6;
107
+ }
108
+
109
+ .react-calendar__tile--now {
110
+ background: #ffff76;
111
+ }
112
+
113
+ .react-calendar__tile--now:enabled:hover,
114
+ .react-calendar__tile--now:enabled:focus {
115
+ background: #ffffa9;
116
+ }
117
+
118
+ .react-calendar__tile--hasActive {
119
+ background: #76baff;
120
+ }
121
+
122
+ .react-calendar__tile--hasActive:enabled:hover,
123
+ .react-calendar__tile--hasActive:enabled:focus {
124
+ background: #a9d4ff;
125
+ }
126
+
127
+ .react-calendar__tile--active {
128
+ background: #006edc;
129
+ color: white;
130
+ }
131
+
132
+ .react-calendar__tile--active:enabled:hover,
133
+ .react-calendar__tile--active:enabled:focus {
134
+ background: #1087ff;
135
+ }
136
+
137
+ .react-calendar--selectRange .react-calendar__tile--hover {
138
+ background-color: #e6e6e6;
139
+ }
140
+ .react-calendar {
141
+ border-color: #{u.color("gray400")};
142
+ }
143
+ .react-calendar button {
144
+ justify-content: center;
145
+ }
146
+ .react-calendar {
147
+ button {
148
+ border-radius: unset;
149
+ padding: 12px 0px;
150
+ }
151
+ }
152
+ .react-calendar__year-view, .react-calendar__decade-view, .react-calendar__century-view {
153
+ button {
154
+ padding: 18px 0px;
155
+ }
156
+ }
157
+
158
+ }