@vtex/faststore 0.0.5 → 0.0.6

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 (232) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/actions.json +181 -0
  3. package/dist/catalog.json +1543 -495
  4. package/dist/client.d.ts +2 -1
  5. package/dist/client.js +2 -1
  6. package/dist/components.d.ts +28 -7
  7. package/dist/components.js +31 -12
  8. package/dist/docs/access-code-sign-in.md +1 -1
  9. package/dist/docs/address-summary.md +24 -3
  10. package/dist/docs/alert-dialog.md +204 -0
  11. package/dist/docs/billing-address.md +284 -0
  12. package/dist/docs/card-entry.md +250 -0
  13. package/dist/docs/cardholder-document.md +142 -0
  14. package/dist/docs/client-preferences-fieldset.md +148 -0
  15. package/dist/docs/client-preferences.md +2 -1
  16. package/dist/docs/client-profile-fieldset.md +184 -0
  17. package/dist/docs/client-profile.md +1 -1
  18. package/dist/docs/document-field.md +58 -4
  19. package/dist/docs/field.md +317 -0
  20. package/dist/docs/form.md +307 -0
  21. package/dist/docs/identity-edit.md +6 -6
  22. package/dist/docs/identity-summary.md +5 -5
  23. package/dist/docs/installments.md +248 -0
  24. package/dist/docs/my-account-profile.md +1 -0
  25. package/dist/docs/order-placed-payment-summary.md +138 -0
  26. package/dist/docs/payment-method-badges.md +232 -0
  27. package/dist/docs/payment-methods.md +1 -0
  28. package/dist/docs/payment.md +218 -0
  29. package/dist/docs/phone-field.md +58 -4
  30. package/dist/docs/place-order.md +157 -0
  31. package/dist/docs/save-card.md +186 -0
  32. package/dist/docs/saved-cards.md +218 -0
  33. package/dist/docs/select.md +465 -0
  34. package/dist/docs/shipping-address.md +110 -258
  35. package/dist/index.d.ts +4 -1
  36. package/dist/internal/client.d.ts +3 -1
  37. package/dist/internal/client.js +3 -1
  38. package/dist/matter/access-code-sign-in/access-code-sign-in.js +9 -8
  39. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
  40. package/dist/matter/billing-address/billing-address.d.ts +165 -0
  41. package/dist/matter/billing-address/billing-address.js +408 -0
  42. package/dist/matter/billing-address/billing-address.js.map +1 -0
  43. package/dist/matter/card-entry/card-capture.d.ts +25 -0
  44. package/dist/matter/card-entry/card-capture.js +25 -0
  45. package/dist/matter/card-entry/card-capture.js.map +1 -0
  46. package/dist/matter/card-entry/card-entry.d.ts +120 -0
  47. package/dist/matter/card-entry/card-entry.js +832 -0
  48. package/dist/matter/card-entry/card-entry.js.map +1 -0
  49. package/dist/matter/cardholder-document/cardholder-document.d.ts +45 -0
  50. package/dist/matter/cardholder-document/cardholder-document.js +70 -0
  51. package/dist/matter/cardholder-document/cardholder-document.js.map +1 -0
  52. package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +77 -0
  53. package/dist/matter/client-preferences/client-preferences-fieldset.js +299 -0
  54. package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -0
  55. package/dist/matter/client-preferences/client-preferences.d.ts +3 -5
  56. package/dist/matter/client-preferences/client-preferences.js +6 -6
  57. package/dist/matter/client-preferences/client-preferences.js.map +1 -1
  58. package/dist/matter/client-profile/client-profile.d.ts +4 -6
  59. package/dist/matter/client-profile/client-profile.js +9 -6
  60. package/dist/matter/client-profile/client-profile.js.map +1 -1
  61. package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -0
  62. package/dist/matter/client-profile-form/client-profile-fieldset.js +488 -0
  63. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -0
  64. package/dist/matter/identity-edit/identity-edit.js +2 -2
  65. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  66. package/dist/matter/identity-summary/identity-summary.js +2 -2
  67. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  68. package/dist/matter/installments/installments-select.d.ts +42 -0
  69. package/dist/matter/installments/installments-select.js +167 -0
  70. package/dist/matter/installments/installments-select.js.map +1 -0
  71. package/dist/matter/installments/installments.d.ts +58 -0
  72. package/dist/matter/installments/installments.js +176 -0
  73. package/dist/matter/installments/installments.js.map +1 -0
  74. package/dist/matter/installments/use-installments-selection.d.ts +29 -0
  75. package/dist/matter/installments/use-installments-selection.js +95 -0
  76. package/dist/matter/installments/use-installments-selection.js.map +1 -0
  77. package/dist/matter/my-account-profile/my-account-profile.js +4 -4
  78. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  79. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +63 -0
  80. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +305 -0
  81. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -0
  82. package/dist/matter/payment/payment-card-capture.d.ts +19 -0
  83. package/dist/matter/payment/payment-card-capture.js +129 -0
  84. package/dist/matter/payment/payment-card-capture.js.map +1 -0
  85. package/dist/matter/payment/payment-controller.d.ts +24 -0
  86. package/dist/matter/payment/payment-controller.js +107 -0
  87. package/dist/matter/payment/payment-controller.js.map +1 -0
  88. package/dist/matter/payment/payment-method-badges.d.ts +57 -0
  89. package/dist/matter/payment/payment-method-badges.js +192 -0
  90. package/dist/matter/payment/payment-method-badges.js.map +1 -0
  91. package/dist/matter/payment/payment.d.ts +89 -0
  92. package/dist/matter/payment/payment.js +263 -0
  93. package/dist/matter/payment/payment.js.map +1 -0
  94. package/dist/matter/payment/use-payment-method-selection.d.ts +302 -0
  95. package/dist/matter/payment/use-payment-method-selection.js +458 -0
  96. package/dist/matter/payment/use-payment-method-selection.js.map +1 -0
  97. package/dist/matter/payment/use-payment-submit-gate.d.ts +111 -0
  98. package/dist/matter/payment/use-payment-submit-gate.js +144 -0
  99. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -0
  100. package/dist/matter/place-order/place-order.d.ts +74 -0
  101. package/dist/matter/place-order/place-order.js +379 -0
  102. package/dist/matter/place-order/place-order.js.map +1 -0
  103. package/dist/matter/product-list/product-list.d.ts +1 -0
  104. package/dist/matter/product-list/product-list.js.map +1 -1
  105. package/dist/matter/product-shelf/product-shelf.d.ts +1 -0
  106. package/dist/matter/product-shelf/product-shelf.js +2 -0
  107. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  108. package/dist/matter/region/region.js +1 -1
  109. package/dist/matter/region/region.js.map +1 -1
  110. package/dist/matter/save-card/save-card.d.ts +49 -0
  111. package/dist/matter/save-card/save-card.js +188 -0
  112. package/dist/matter/save-card/save-card.js.map +1 -0
  113. package/dist/matter/saved-cards/saved-cards.d.ts +79 -0
  114. package/dist/matter/saved-cards/saved-cards.js +387 -0
  115. package/dist/matter/saved-cards/saved-cards.js.map +1 -0
  116. package/dist/matter/shipping-address/country-descriptors.js +20 -10
  117. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  118. package/dist/matter/shipping-address/shipping-address.d.ts +113 -174
  119. package/dist/matter/shipping-address/shipping-address.js +480 -791
  120. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  121. package/dist/matter/variant-selector/variant-selector.js +1 -1
  122. package/dist/particles/address-summary/address-summary.d.ts +24 -0
  123. package/dist/particles/address-summary/address-summary.js +83 -2
  124. package/dist/particles/address-summary/address-summary.js.map +1 -1
  125. package/dist/particles/alert-dialog/alert-dialog.d.ts +68 -0
  126. package/dist/particles/alert-dialog/alert-dialog.js +187 -0
  127. package/dist/particles/alert-dialog/alert-dialog.js.map +1 -0
  128. package/dist/particles/checkbox/checkbox.d.ts +7 -3
  129. package/dist/particles/checkbox/checkbox.js +4 -1
  130. package/dist/particles/checkbox/checkbox.js.map +1 -1
  131. package/dist/particles/document-field/document-field.d.ts +48 -5
  132. package/dist/particles/document-field/document-field.js +189 -32
  133. package/dist/particles/document-field/document-field.js.map +1 -1
  134. package/dist/particles/field/bound-field-registry.js +52 -0
  135. package/dist/particles/field/bound-field-registry.js.map +1 -0
  136. package/dist/particles/field/field.d.ts +116 -0
  137. package/dist/particles/field/field.js +497 -6
  138. package/dist/particles/field/field.js.map +1 -1
  139. package/dist/particles/fieldset/fieldset.js +2 -2
  140. package/dist/particles/fieldset/fieldset.js.map +1 -1
  141. package/dist/particles/form/form.d.ts +104 -0
  142. package/dist/particles/form/form.js +485 -0
  143. package/dist/particles/form/form.js.map +1 -0
  144. package/dist/particles/phone-field/phone-field.d.ts +38 -10
  145. package/dist/particles/phone-field/phone-field.js +183 -39
  146. package/dist/particles/phone-field/phone-field.js.map +1 -1
  147. package/dist/particles/postal-code-field/postal-code-field.js +2 -2
  148. package/dist/particles/postal-code-field/postal-code-field.js.map +1 -1
  149. package/dist/particles/select/field-select.d.ts +43 -0
  150. package/dist/particles/select/field-select.js +150 -0
  151. package/dist/particles/select/field-select.js.map +1 -0
  152. package/dist/particles/select/select.d.ts +2 -0
  153. package/dist/particles/select/select.js.map +1 -1
  154. package/dist/particles/shared/compose-refs.js +21 -0
  155. package/dist/particles/shared/compose-refs.js.map +1 -0
  156. package/dist/schema.graphql +701 -2
  157. package/dist/sdk/actions/analytics-action-provider.d.ts +15 -0
  158. package/dist/sdk/actions/analytics-action-provider.js +19 -0
  159. package/dist/sdk/actions/analytics-action-provider.js.map +1 -0
  160. package/dist/sdk/actions/index.d.ts +3 -1
  161. package/dist/sdk/actions/index.js +3 -1
  162. package/dist/sdk/actions/payment-action-provider.d.ts +22 -0
  163. package/dist/sdk/actions/payment-action-provider.js +26 -0
  164. package/dist/sdk/actions/payment-action-provider.js.map +1 -0
  165. package/dist/sdk/actions/types.d.ts +6 -2
  166. package/dist/sdk/analytics/analytics-destination.d.ts +43 -0
  167. package/dist/sdk/analytics/analytics-destination.js +90 -0
  168. package/dist/sdk/analytics/analytics-destination.js.map +1 -0
  169. package/dist/sdk/analytics/use-analytics-actions.d.ts +57 -0
  170. package/dist/sdk/analytics/use-analytics-actions.js +108 -0
  171. package/dist/sdk/analytics/use-analytics-actions.js.map +1 -0
  172. package/dist/sdk/cart/use-cart-actions.js +1 -1
  173. package/dist/sdk/data/entity-resolution-context.js +31 -0
  174. package/dist/sdk/data/entity-resolution-context.js.map +1 -0
  175. package/dist/sdk/data/entity-subscriber.js +18 -8
  176. package/dist/sdk/data/entity-subscriber.js.map +1 -1
  177. package/dist/sdk/data/index.js +1 -0
  178. package/dist/sdk/data/page-reactive-data-root.d.ts +36 -0
  179. package/dist/sdk/data/page-reactive-data-root.js +4 -2
  180. package/dist/sdk/data/page-reactive-data-root.js.map +1 -1
  181. package/dist/sdk/data/reactive-data-provider.js +7 -3
  182. package/dist/sdk/data/reactive-data-provider.js.map +1 -1
  183. package/dist/sdk/data/reactive-list-item-data-provider.js +12 -4
  184. package/dist/sdk/data/reactive-list-item-data-provider.js.map +1 -1
  185. package/dist/sdk/data/use-reactive-data-settled.js +39 -0
  186. package/dist/sdk/data/use-reactive-data-settled.js.map +1 -0
  187. package/dist/sdk/data/use-reactive-entity.js +5 -1
  188. package/dist/sdk/data/use-reactive-entity.js.map +1 -1
  189. package/dist/sdk/generated/fragment-types.js +2 -0
  190. package/dist/sdk/generated/fragment-types.js.map +1 -1
  191. package/dist/sdk/generated/graphql.js.map +1 -1
  192. package/dist/sdk/i18n/messages/en-US.js +3 -0
  193. package/dist/sdk/i18n/messages/en-US.json +3 -0
  194. package/dist/sdk/i18n/messages/en-US.json.d.ts +3 -0
  195. package/dist/sdk/i18n/messages/es-ES.js +3 -0
  196. package/dist/sdk/i18n/messages/es-ES.json +3 -0
  197. package/dist/sdk/i18n/messages/pt-BR.js +3 -0
  198. package/dist/sdk/i18n/messages/pt-BR.json +3 -0
  199. package/dist/sdk/identity/use-identity-actions.js +3 -2
  200. package/dist/sdk/identity/use-identity-actions.js.map +1 -1
  201. package/dist/sdk/payment/gateway-origin.js +35 -0
  202. package/dist/sdk/payment/gateway-origin.js.map +1 -0
  203. package/dist/sdk/payment/gateway.d.ts +85 -0
  204. package/dist/sdk/payment/gateway.js +183 -0
  205. package/dist/sdk/payment/gateway.js.map +1 -0
  206. package/dist/sdk/payment/operations.d.ts +52 -0
  207. package/dist/sdk/payment/operations.js +223 -0
  208. package/dist/sdk/payment/operations.js.map +1 -0
  209. package/dist/sdk/payment/security-code-mask.js +71 -0
  210. package/dist/sdk/payment/security-code-mask.js.map +1 -0
  211. package/dist/sdk/payment/submission-registry.d.ts +33 -0
  212. package/dist/sdk/payment/submission-registry.js +58 -0
  213. package/dist/sdk/payment/submission-registry.js.map +1 -0
  214. package/dist/sdk/payment/use-payment-actions.d.ts +78 -0
  215. package/dist/sdk/payment/use-payment-actions.js +276 -0
  216. package/dist/sdk/payment/use-payment-actions.js.map +1 -0
  217. package/dist/sdk/payment/use-place-order.d.ts +65 -0
  218. package/dist/sdk/payment/use-place-order.js +640 -0
  219. package/dist/sdk/payment/use-place-order.js.map +1 -0
  220. package/dist/sdk/shipping/use-shipping-actions.js +1 -1
  221. package/dist/utils/loggable-error-name.js +49 -0
  222. package/dist/utils/loggable-error-name.js.map +1 -0
  223. package/dist/utils/resolve-authored-copy.js +18 -0
  224. package/dist/utils/resolve-authored-copy.js.map +1 -0
  225. package/dist/utils/substitute-template.js +33 -0
  226. package/dist/utils/substitute-template.js.map +1 -0
  227. package/package.json +2 -1
  228. package/src/styles/tailwind.css +34 -0
  229. package/dist/docs/client-profile-form.md +0 -192
  230. package/dist/matter/client-profile-form/client-profile-form.d.ts +0 -126
  231. package/dist/matter/client-profile-form/client-profile-form.js +0 -662
  232. package/dist/matter/client-profile-form/client-profile-form.js.map +0 -1
@@ -0,0 +1,68 @@
1
+ import { ComponentDefinition } from "../../core/dist/define-component.js";
2
+ import "../../core/dist/index.js";
3
+ import { ComponentProps, ComponentPropsWithRef, ReactNode } from "react";
4
+ import { AlertDialog } from "@base-ui/react/alert-dialog";
5
+ //#region src/particles/alert-dialog/alert-dialog.d.ts
6
+ type BasePopupProps = ComponentProps<typeof AlertDialog.Popup>;
7
+ export type AlertDialogRootProps = Readonly<{
8
+ open?: boolean;
9
+ defaultOpen?: boolean;
10
+ onOpenChange?: (open: boolean, eventDetails: {
11
+ isCanceled: boolean;
12
+ }) => void;
13
+ children?: ReactNode;
14
+ }>;
15
+ export type AlertDialogTriggerProps = ComponentPropsWithRef<'button'>;
16
+ export type AlertDialogPortalProps = Readonly<{
17
+ children?: ReactNode;
18
+ }>;
19
+ export type AlertDialogBackdropProps = ComponentPropsWithRef<'div'>;
20
+ export type AlertDialogViewportProps = ComponentPropsWithRef<'div'>;
21
+ export type AlertDialogPopupProps = ComponentPropsWithRef<'div'> & {
22
+ initialFocus?: BasePopupProps['initialFocus'];
23
+ finalFocus?: BasePopupProps['finalFocus'];
24
+ };
25
+ export type AlertDialogTitleProps = ComponentPropsWithRef<'h2'>;
26
+ export type AlertDialogDescriptionProps = ComponentPropsWithRef<'p'>;
27
+ export type AlertDialogCloseProps = ComponentPropsWithRef<'button'>;
28
+ export declare const AlertDialogRootDefinition: ComponentDefinition<Readonly<{
29
+ open?: boolean;
30
+ defaultOpen?: boolean;
31
+ onOpenChange?: (open: boolean, eventDetails: {
32
+ isCanceled: boolean;
33
+ }) => void;
34
+ children?: ReactNode;
35
+ }>>;
36
+ export declare const AlertDialogTriggerDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
37
+ export declare const AlertDialogPortalDefinition: ComponentDefinition<Readonly<{
38
+ children?: ReactNode;
39
+ }>>;
40
+ export declare const AlertDialogBackdropDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
41
+ export declare const AlertDialogViewportDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
42
+ export declare const AlertDialogPopupDefinition: ComponentDefinition<AlertDialogPopupProps>;
43
+ export declare const AlertDialogTitleDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
44
+ export declare const AlertDialogDescriptionDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>>;
45
+ export declare const AlertDialogCloseDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
46
+ export declare function AlertDialogRoot({ open, defaultOpen, onOpenChange, children }: AlertDialogRootProps): import("react/jsx-runtime").JSX.Element;
47
+ export declare function AlertDialogTrigger({ className, children, ...props }: AlertDialogTriggerProps): import("react/jsx-runtime").JSX.Element;
48
+ export declare function AlertDialogPortal({ children }: AlertDialogPortalProps): import("react/jsx-runtime").JSX.Element;
49
+ export declare function AlertDialogBackdrop({ className, children, ...props }: AlertDialogBackdropProps): import("react/jsx-runtime").JSX.Element;
50
+ export declare function AlertDialogViewport({ className, children, ...props }: AlertDialogViewportProps): import("react/jsx-runtime").JSX.Element;
51
+ export declare function AlertDialogPopup({ className, children, ...props }: AlertDialogPopupProps): import("react/jsx-runtime").JSX.Element;
52
+ export declare function AlertDialogTitle({ className, children, ...props }: AlertDialogTitleProps): import("react/jsx-runtime").JSX.Element;
53
+ export declare function AlertDialogDescription({ className, children, ...props }: AlertDialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
54
+ export declare function AlertDialogClose({ className, children, ...props }: AlertDialogCloseProps): import("react/jsx-runtime").JSX.Element;
55
+ declare const AlertDialog$1: {
56
+ Root: typeof AlertDialogRoot;
57
+ Trigger: typeof AlertDialogTrigger;
58
+ Portal: typeof AlertDialogPortal;
59
+ Backdrop: typeof AlertDialogBackdrop;
60
+ Viewport: typeof AlertDialogViewport;
61
+ Popup: typeof AlertDialogPopup;
62
+ Title: typeof AlertDialogTitle;
63
+ Description: typeof AlertDialogDescription;
64
+ Close: typeof AlertDialogClose;
65
+ };
66
+ //#endregion
67
+ export { AlertDialog$1 as AlertDialog };
68
+ //# sourceMappingURL=alert-dialog.d.ts.map
@@ -0,0 +1,187 @@
1
+ "use client";
2
+ import { defineComponent } from "../../core/dist/define-component.js";
3
+ import "../../core/dist/index.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { AlertDialog } from "@base-ui/react/alert-dialog";
6
+ //#region src/particles/alert-dialog/alert-dialog.tsx
7
+ const AlertDialogRootDefinition = defineComponent({
8
+ name: "AlertDialogRoot",
9
+ importPath: "@vtex/faststore/components",
10
+ component: AlertDialogRoot,
11
+ editor: {
12
+ label: "Alert Dialog Root",
13
+ category: "layout"
14
+ },
15
+ schema: {},
16
+ guideline: "Root of a confirmation prompt for an irreversible action. Compose as: AlertDialogRoot > (AlertDialogTrigger + AlertDialogPortal > (AlertDialogBackdrop + AlertDialogViewport > AlertDialogPopup > (AlertDialogTitle + AlertDialogDescription + AlertDialogClose + your confirm Button))). Always modal and never closes on an outside click; only Escape or an AlertDialogClose dismisses it. Use Dialog instead when a stray click may close the overlay."
17
+ });
18
+ const AlertDialogTriggerDefinition = defineComponent({
19
+ name: "AlertDialogTrigger",
20
+ importPath: "@vtex/faststore/components",
21
+ component: AlertDialogTrigger,
22
+ editor: {
23
+ label: "Alert Dialog Trigger",
24
+ category: "action"
25
+ },
26
+ schema: {},
27
+ guideline: "Opens the alert dialog when clicked. Direct child of AlertDialogRoot. Accepts any children (text, Icon). Base UI connects it to AlertDialogRoot via context — no explicit wiring needed."
28
+ });
29
+ const AlertDialogPortalDefinition = defineComponent({
30
+ name: "AlertDialogPortal",
31
+ importPath: "@vtex/faststore/components",
32
+ component: AlertDialogPortal,
33
+ editor: {
34
+ label: "Alert Dialog Portal",
35
+ category: "layout"
36
+ },
37
+ schema: {},
38
+ guideline: "Renders its children outside the DOM tree (into document.body). Place AlertDialogBackdrop and AlertDialogViewport as direct children, in that order."
39
+ });
40
+ const AlertDialogBackdropDefinition = defineComponent({
41
+ name: "AlertDialogBackdrop",
42
+ importPath: "@vtex/faststore/components",
43
+ component: AlertDialogBackdrop,
44
+ editor: {
45
+ label: "Alert Dialog Backdrop",
46
+ category: "layout"
47
+ },
48
+ schema: {},
49
+ guideline: "Semi-transparent overlay behind the popup. Direct child of AlertDialogPortal, before AlertDialogViewport. Clicking it does not close the alert dialog."
50
+ });
51
+ const AlertDialogViewportDefinition = defineComponent({
52
+ name: "AlertDialogViewport",
53
+ importPath: "@vtex/faststore/components",
54
+ component: AlertDialogViewport,
55
+ editor: {
56
+ label: "Alert Dialog Viewport",
57
+ category: "layout"
58
+ },
59
+ schema: {},
60
+ guideline: "Positioning container for AlertDialogPopup. Direct child of AlertDialogPortal, after AlertDialogBackdrop. Apply fixed positioning and centering here (e.g. fixed inset-0 flex items-center justify-center). Place AlertDialogPopup inside."
61
+ });
62
+ const AlertDialogPopupDefinition = defineComponent({
63
+ name: "AlertDialogPopup",
64
+ importPath: "@vtex/faststore/components",
65
+ component: AlertDialogPopup,
66
+ editor: {
67
+ label: "Alert Dialog Popup",
68
+ category: "layout"
69
+ },
70
+ schema: {},
71
+ guideline: "The visible prompt, inside AlertDialogViewport, with role alertdialog. Place AlertDialogTitle (required), AlertDialogDescription, an AlertDialogClose for cancel, and a confirm Button inside. Focus starts on the first focusable element, except when opened by touch, where Base UI focuses the popup itself: put the cancel control first, and pass initialFocus (a ref) when Cancel must receive focus for every kind of interaction."
72
+ });
73
+ const AlertDialogTitleDefinition = defineComponent({
74
+ name: "AlertDialogTitle",
75
+ importPath: "@vtex/faststore/components",
76
+ component: AlertDialogTitle,
77
+ editor: {
78
+ label: "Alert Dialog Title",
79
+ category: "layout"
80
+ },
81
+ schema: {},
82
+ guideline: "Required heading inside AlertDialogPopup — sets the accessible name of the alert dialog for screen readers. State the question, e.g. \"Delete this address?\"."
83
+ });
84
+ const AlertDialogDescriptionDefinition = defineComponent({
85
+ name: "AlertDialogDescription",
86
+ importPath: "@vtex/faststore/components",
87
+ component: AlertDialogDescription,
88
+ editor: {
89
+ label: "Alert Dialog Description",
90
+ category: "layout"
91
+ },
92
+ schema: {},
93
+ guideline: "Description inside AlertDialogPopup, after AlertDialogTitle. Screen readers announce it with the prompt, so use it to state the consequence of confirming."
94
+ });
95
+ const AlertDialogCloseDefinition = defineComponent({
96
+ name: "AlertDialogClose",
97
+ importPath: "@vtex/faststore/components",
98
+ component: AlertDialogClose,
99
+ editor: {
100
+ label: "Alert Dialog Close",
101
+ category: "action"
102
+ },
103
+ schema: {},
104
+ guideline: "Closes the alert dialog when clicked. Use it for the cancel control inside AlertDialogPopup. The confirm control is a separate Button that runs the consumer action."
105
+ });
106
+ function AlertDialogRoot({ open, defaultOpen, onOpenChange, children }) {
107
+ return /* @__PURE__ */ jsx(AlertDialog.Root, {
108
+ open,
109
+ defaultOpen,
110
+ onOpenChange,
111
+ children
112
+ });
113
+ }
114
+ function AlertDialogTrigger({ className, children, ...props }) {
115
+ return /* @__PURE__ */ jsx(AlertDialog.Trigger, {
116
+ ...props,
117
+ className,
118
+ "data-fs-alert-dialog-trigger": "",
119
+ children
120
+ });
121
+ }
122
+ function AlertDialogPortal({ children }) {
123
+ return /* @__PURE__ */ jsx(AlertDialog.Portal, { children });
124
+ }
125
+ function AlertDialogBackdrop({ className, children, ...props }) {
126
+ return /* @__PURE__ */ jsx(AlertDialog.Backdrop, {
127
+ ...props,
128
+ className,
129
+ "data-fs-alert-dialog-backdrop": "",
130
+ children
131
+ });
132
+ }
133
+ function AlertDialogViewport({ className, children, ...props }) {
134
+ return /* @__PURE__ */ jsx("div", {
135
+ ...props,
136
+ className,
137
+ "data-fs-alert-dialog-viewport": "",
138
+ children
139
+ });
140
+ }
141
+ function AlertDialogPopup({ className, children, ...props }) {
142
+ return /* @__PURE__ */ jsx(AlertDialog.Popup, {
143
+ ...props,
144
+ className,
145
+ "data-fs-alert-dialog-popup": "",
146
+ children
147
+ });
148
+ }
149
+ function AlertDialogTitle({ className, children, ...props }) {
150
+ return /* @__PURE__ */ jsx(AlertDialog.Title, {
151
+ ...props,
152
+ className,
153
+ "data-fs-alert-dialog-title": "",
154
+ children
155
+ });
156
+ }
157
+ function AlertDialogDescription({ className, children, ...props }) {
158
+ return /* @__PURE__ */ jsx(AlertDialog.Description, {
159
+ ...props,
160
+ className,
161
+ "data-fs-alert-dialog-description": "",
162
+ children
163
+ });
164
+ }
165
+ function AlertDialogClose({ className, children, ...props }) {
166
+ return /* @__PURE__ */ jsx(AlertDialog.Close, {
167
+ ...props,
168
+ className,
169
+ "data-fs-alert-dialog-close": "",
170
+ children
171
+ });
172
+ }
173
+ const AlertDialog$1 = {
174
+ Root: AlertDialogRoot,
175
+ Trigger: AlertDialogTrigger,
176
+ Portal: AlertDialogPortal,
177
+ Backdrop: AlertDialogBackdrop,
178
+ Viewport: AlertDialogViewport,
179
+ Popup: AlertDialogPopup,
180
+ Title: AlertDialogTitle,
181
+ Description: AlertDialogDescription,
182
+ Close: AlertDialogClose
183
+ };
184
+ //#endregion
185
+ export { AlertDialog$1 as AlertDialog, AlertDialogBackdrop, AlertDialogBackdropDefinition, AlertDialogClose, AlertDialogCloseDefinition, AlertDialogDescription, AlertDialogDescriptionDefinition, AlertDialogPopup, AlertDialogPopupDefinition, AlertDialogPortal, AlertDialogPortalDefinition, AlertDialogRoot, AlertDialogRootDefinition, AlertDialogTitle, AlertDialogTitleDefinition, AlertDialogTrigger, AlertDialogTriggerDefinition, AlertDialogViewport, AlertDialogViewportDefinition };
186
+
187
+ //# sourceMappingURL=alert-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert-dialog.js","names":["BaseAlertDialog","AlertDialog"],"sources":["../../../src/particles/alert-dialog/alert-dialog.tsx"],"sourcesContent":["'use client';\nimport { AlertDialog as BaseAlertDialog } from '@base-ui/react/alert-dialog';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentProps, ComponentPropsWithRef, ReactNode } from 'react';\n\ntype BasePopupProps = ComponentProps<typeof BaseAlertDialog.Popup>;\n\nexport type AlertDialogRootProps = Readonly<{\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean, eventDetails: { isCanceled: boolean }) => void;\n children?: ReactNode;\n}>;\n\nexport type AlertDialogTriggerProps = ComponentPropsWithRef<'button'>;\n\nexport type AlertDialogPortalProps = Readonly<{\n children?: ReactNode;\n}>;\n\nexport type AlertDialogBackdropProps = ComponentPropsWithRef<'div'>;\n\nexport type AlertDialogViewportProps = ComponentPropsWithRef<'div'>;\n\nexport type AlertDialogPopupProps = ComponentPropsWithRef<'div'> & {\n initialFocus?: BasePopupProps['initialFocus'];\n finalFocus?: BasePopupProps['finalFocus'];\n};\n\nexport type AlertDialogTitleProps = ComponentPropsWithRef<'h2'>;\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithRef<'p'>;\n\nexport type AlertDialogCloseProps = ComponentPropsWithRef<'button'>;\n\nexport const AlertDialogRootDefinition = defineComponent<AlertDialogRootProps>({\n name: 'AlertDialogRoot',\n importPath: '@vtex/faststore/components',\n component: AlertDialogRoot,\n editor: { label: 'Alert Dialog Root', category: 'layout' },\n schema: {},\n guideline:\n 'Root of a confirmation prompt for an irreversible action. Compose as: AlertDialogRoot > (AlertDialogTrigger + AlertDialogPortal > (AlertDialogBackdrop + AlertDialogViewport > AlertDialogPopup > (AlertDialogTitle + AlertDialogDescription + AlertDialogClose + your confirm Button))). Always modal and never closes on an outside click; only Escape or an AlertDialogClose dismisses it. Use Dialog instead when a stray click may close the overlay.',\n});\n\nexport const AlertDialogTriggerDefinition = defineComponent<AlertDialogTriggerProps>({\n name: 'AlertDialogTrigger',\n importPath: '@vtex/faststore/components',\n component: AlertDialogTrigger,\n editor: { label: 'Alert Dialog Trigger', category: 'action' },\n schema: {},\n guideline:\n 'Opens the alert dialog when clicked. Direct child of AlertDialogRoot. Accepts any children (text, Icon). Base UI connects it to AlertDialogRoot via context — no explicit wiring needed.',\n});\n\nexport const AlertDialogPortalDefinition = defineComponent<AlertDialogPortalProps>({\n name: 'AlertDialogPortal',\n importPath: '@vtex/faststore/components',\n component: AlertDialogPortal,\n editor: { label: 'Alert Dialog Portal', category: 'layout' },\n schema: {},\n guideline:\n 'Renders its children outside the DOM tree (into document.body). Place AlertDialogBackdrop and AlertDialogViewport as direct children, in that order.',\n});\n\nexport const AlertDialogBackdropDefinition = defineComponent<AlertDialogBackdropProps>({\n name: 'AlertDialogBackdrop',\n importPath: '@vtex/faststore/components',\n component: AlertDialogBackdrop,\n editor: { label: 'Alert Dialog Backdrop', category: 'layout' },\n schema: {},\n guideline:\n 'Semi-transparent overlay behind the popup. Direct child of AlertDialogPortal, before AlertDialogViewport. Clicking it does not close the alert dialog.',\n});\n\nexport const AlertDialogViewportDefinition = defineComponent<AlertDialogViewportProps>({\n name: 'AlertDialogViewport',\n importPath: '@vtex/faststore/components',\n component: AlertDialogViewport,\n editor: { label: 'Alert Dialog Viewport', category: 'layout' },\n schema: {},\n guideline:\n 'Positioning container for AlertDialogPopup. Direct child of AlertDialogPortal, after AlertDialogBackdrop. Apply fixed positioning and centering here (e.g. fixed inset-0 flex items-center justify-center). Place AlertDialogPopup inside.',\n});\n\nexport const AlertDialogPopupDefinition = defineComponent<AlertDialogPopupProps>({\n name: 'AlertDialogPopup',\n importPath: '@vtex/faststore/components',\n component: AlertDialogPopup,\n editor: { label: 'Alert Dialog Popup', category: 'layout' },\n schema: {},\n guideline:\n 'The visible prompt, inside AlertDialogViewport, with role alertdialog. Place AlertDialogTitle (required), AlertDialogDescription, an AlertDialogClose for cancel, and a confirm Button inside. Focus starts on the first focusable element, except when opened by touch, where Base UI focuses the popup itself: put the cancel control first, and pass initialFocus (a ref) when Cancel must receive focus for every kind of interaction.',\n});\n\nexport const AlertDialogTitleDefinition = defineComponent<AlertDialogTitleProps>({\n name: 'AlertDialogTitle',\n importPath: '@vtex/faststore/components',\n component: AlertDialogTitle,\n editor: { label: 'Alert Dialog Title', category: 'layout' },\n schema: {},\n guideline:\n 'Required heading inside AlertDialogPopup — sets the accessible name of the alert dialog for screen readers. State the question, e.g. \"Delete this address?\".',\n});\n\nexport const AlertDialogDescriptionDefinition = defineComponent<AlertDialogDescriptionProps>({\n name: 'AlertDialogDescription',\n importPath: '@vtex/faststore/components',\n component: AlertDialogDescription,\n editor: { label: 'Alert Dialog Description', category: 'layout' },\n schema: {},\n guideline:\n 'Description inside AlertDialogPopup, after AlertDialogTitle. Screen readers announce it with the prompt, so use it to state the consequence of confirming.',\n});\n\nexport const AlertDialogCloseDefinition = defineComponent<AlertDialogCloseProps>({\n name: 'AlertDialogClose',\n importPath: '@vtex/faststore/components',\n component: AlertDialogClose,\n editor: { label: 'Alert Dialog Close', category: 'action' },\n schema: {},\n guideline:\n 'Closes the alert dialog when clicked. Use it for the cancel control inside AlertDialogPopup. The confirm control is a separate Button that runs the consumer action.',\n});\n\nexport function AlertDialogRoot({ open, defaultOpen, onOpenChange, children }: AlertDialogRootProps) {\n return (\n <BaseAlertDialog.Root open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n {children}\n </BaseAlertDialog.Root>\n );\n}\n\nexport function AlertDialogTrigger({ className, children, ...props }: AlertDialogTriggerProps) {\n return (\n <BaseAlertDialog.Trigger {...props} className={className} data-fs-alert-dialog-trigger=\"\">\n {children}\n </BaseAlertDialog.Trigger>\n );\n}\n\nexport function AlertDialogPortal({ children }: AlertDialogPortalProps) {\n return <BaseAlertDialog.Portal>{children}</BaseAlertDialog.Portal>;\n}\n\nexport function AlertDialogBackdrop({ className, children, ...props }: AlertDialogBackdropProps) {\n return (\n <BaseAlertDialog.Backdrop {...props} className={className} data-fs-alert-dialog-backdrop=\"\">\n {children}\n </BaseAlertDialog.Backdrop>\n );\n}\n\nexport function AlertDialogViewport({ className, children, ...props }: AlertDialogViewportProps) {\n return (\n <div {...props} className={className} data-fs-alert-dialog-viewport=\"\">\n {children}\n </div>\n );\n}\n\nexport function AlertDialogPopup({ className, children, ...props }: AlertDialogPopupProps) {\n return (\n <BaseAlertDialog.Popup {...props} className={className} data-fs-alert-dialog-popup=\"\">\n {children}\n </BaseAlertDialog.Popup>\n );\n}\n\nexport function AlertDialogTitle({ className, children, ...props }: AlertDialogTitleProps) {\n return (\n <BaseAlertDialog.Title {...props} className={className} data-fs-alert-dialog-title=\"\">\n {children}\n </BaseAlertDialog.Title>\n );\n}\n\nexport function AlertDialogDescription({ className, children, ...props }: AlertDialogDescriptionProps) {\n return (\n <BaseAlertDialog.Description {...props} className={className} data-fs-alert-dialog-description=\"\">\n {children}\n </BaseAlertDialog.Description>\n );\n}\n\nexport function AlertDialogClose({ className, children, ...props }: AlertDialogCloseProps) {\n return (\n <BaseAlertDialog.Close {...props} className={className} data-fs-alert-dialog-close=\"\">\n {children}\n </BaseAlertDialog.Close>\n );\n}\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Close: AlertDialogClose,\n};\n"],"mappings":"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"}
@@ -1,8 +1,10 @@
1
1
  import { ComponentDefinition } from "../../core/dist/define-component.js";
2
2
  import "../../core/dist/index.js";
3
- import { ComponentPropsWithRef, ReactNode } from "react";
3
+ import { ComponentPropsWithRef, ReactNode, Ref } from "react";
4
4
  //#region src/particles/checkbox/checkbox.d.ts
5
- export type CheckboxRootProps = {
5
+ export type CheckboxRootProps = Omit<ComponentPropsWithRef<'span'>, 'defaultValue' | 'defaultChecked' | 'onChange' | 'ref' | 'dangerouslySetInnerHTML'> & {
6
+ /** The rendered host element is a span; Base UI types its forwarded ref as HTMLElement because `render` can replace it. */
7
+ ref?: Ref<HTMLElement>;
6
8
  checked?: boolean;
7
9
  defaultChecked?: boolean;
8
10
  onCheckedChange?: (checked: boolean) => void;
@@ -15,6 +17,8 @@ export type CheckboxRootProps = {
15
17
  id?: string;
16
18
  className?: string;
17
19
  children?: ReactNode;
20
+ /** Id of the element this checkbox shows, hides or changes; forwarded to the `role="checkbox"` element. */
21
+ 'aria-controls'?: string;
18
22
  };
19
23
  export type CheckboxIndicatorProps = ComponentPropsWithRef<'span'> & {
20
24
  keepMounted?: boolean;
@@ -29,7 +33,7 @@ export type CheckboxGroupProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValu
29
33
  export declare const CheckboxRootDefinition: ComponentDefinition<CheckboxRootProps>;
30
34
  export declare const CheckboxIndicatorDefinition: ComponentDefinition<CheckboxIndicatorProps>;
31
35
  export declare const CheckboxGroupDefinition: ComponentDefinition<CheckboxGroupProps>;
32
- export declare function CheckboxRoot({ checked, defaultChecked, onCheckedChange, indeterminate, disabled, readOnly, required, name, value, id, className, children }: CheckboxRootProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function CheckboxRoot({ checked, defaultChecked, onCheckedChange, indeterminate, disabled, readOnly, required, name, value, id, className, children, 'aria-controls': ariaControls, ref, ...props }: CheckboxRootProps): import("react/jsx-runtime").JSX.Element;
33
37
  export declare function CheckboxIndicator({ keepMounted, className, children, ...props }: CheckboxIndicatorProps): import("react/jsx-runtime").JSX.Element;
34
38
  export declare function CheckboxGroup({ className, children, ...props }: CheckboxGroupProps): import("react/jsx-runtime").JSX.Element;
35
39
  export declare const Checkbox: {
@@ -38,8 +38,10 @@ const CheckboxGroupDefinition = defineComponent({
38
38
  schema: {},
39
39
  guideline: "Shared state container for a series of checkboxes. Use allValues to enable select-all behavior. Contains Checkbox.Root children with individual value props."
40
40
  });
41
- function CheckboxRoot({ checked, defaultChecked, onCheckedChange, indeterminate, disabled, readOnly, required, name, value, id, className, children }) {
41
+ function CheckboxRoot({ checked, defaultChecked, onCheckedChange, indeterminate, disabled, readOnly, required, name, value, id, className, children, "aria-controls": ariaControls, ref, ...props }) {
42
42
  return /* @__PURE__ */ jsx(Checkbox.Root, {
43
+ ...props,
44
+ ref,
43
45
  checked,
44
46
  defaultChecked,
45
47
  onCheckedChange,
@@ -51,6 +53,7 @@ function CheckboxRoot({ checked, defaultChecked, onCheckedChange, indeterminate,
51
53
  value,
52
54
  id,
53
55
  className,
56
+ "aria-controls": ariaControls,
54
57
  "data-fs-checkbox-root": "",
55
58
  children
56
59
  });
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","names":["CheckboxGroup","BaseCheckbox","BaseCheckboxGroup","Checkbox"],"sources":["../../../src/particles/checkbox/checkbox.tsx"],"sourcesContent":["'use client';\nimport { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';\nimport { CheckboxGroup as BaseCheckboxGroup } from '@base-ui/react/checkbox-group';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\n\nexport type CheckboxRootProps = {\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n indeterminate?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n name?: string;\n value?: string;\n id?: string;\n className?: string;\n children?: ReactNode;\n};\n\nexport type CheckboxIndicatorProps = ComponentPropsWithRef<'span'> & {\n keepMounted?: boolean;\n};\n\nexport type CheckboxGroupProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue'> & {\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (value: string[]) => void;\n allValues?: string[];\n disabled?: boolean;\n};\n\nexport const CheckboxRootDefinition = defineComponent<CheckboxRootProps>({\n name: 'CheckboxRoot',\n importPath: '@vtex/faststore/components',\n component: CheckboxRoot,\n editor: { label: 'Checkbox Root', category: 'action' },\n schema: {},\n guideline:\n 'Form checkbox that integrates with Field for labeling and validation. Requires a Checkbox.Indicator child for visual state. Use indeterminate for partial selection in nested lists.',\n});\n\nexport const CheckboxIndicatorDefinition = defineComponent<CheckboxIndicatorProps>({\n name: 'CheckboxIndicator',\n importPath: '@vtex/faststore/components',\n component: CheckboxIndicator,\n editor: { label: 'Checkbox Indicator', category: 'layout' },\n schema: {},\n guideline:\n 'Visual indicator inside Checkbox.Root showing checked/indeterminate state. Render a checkmark SVG as a child. Visible only when checked or indeterminate via data-checked/data-indeterminate.',\n});\n\nexport const CheckboxGroupDefinition = defineComponent<CheckboxGroupProps>({\n name: 'CheckboxGroup',\n importPath: '@vtex/faststore/components',\n component: CheckboxGroup,\n editor: { label: 'Checkbox Group', category: 'layout' },\n schema: {},\n guideline:\n 'Shared state container for a series of checkboxes. Use allValues to enable select-all behavior. Contains Checkbox.Root children with individual value props.',\n});\n\nexport function CheckboxRoot({\n checked,\n defaultChecked,\n onCheckedChange,\n indeterminate,\n disabled,\n readOnly,\n required,\n name,\n value,\n id,\n className,\n children,\n}: CheckboxRootProps) {\n return (\n <BaseCheckbox.Root\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={onCheckedChange}\n indeterminate={indeterminate}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n value={value}\n id={id}\n className={className}\n data-fs-checkbox-root=\"\"\n >\n {children}\n </BaseCheckbox.Root>\n );\n}\n\nexport function CheckboxIndicator({ keepMounted = false, className, children, ...props }: CheckboxIndicatorProps) {\n return (\n <BaseCheckbox.Indicator {...props} keepMounted={keepMounted} className={className} data-fs-checkbox-indicator=\"\">\n {children}\n </BaseCheckbox.Indicator>\n );\n}\n\nexport function CheckboxGroup({ className, children, ...props }: CheckboxGroupProps) {\n return (\n <BaseCheckboxGroup {...props} className={className} data-fs-checkbox-group=\"\">\n {children}\n </BaseCheckboxGroup>\n );\n}\n\nexport const Checkbox = {\n Root: CheckboxRoot,\n Indicator: CheckboxIndicator,\n};\n"],"mappings":";;;;;;;AAiCA,MAAa,yBAAyB,gBAAmC;CACvE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAiB,UAAU;CAAS;CACrD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,8BAA8B,gBAAwC;CACjF,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAsB,UAAU;CAAS;CAC1D,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,0BAA0B,gBAAoC;CACzE,MAAM;CACN,YAAY;CACZ,WAAWA;CACX,QAAQ;EAAE,OAAO;EAAkB,UAAU;CAAS;CACtD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,SAAgB,aAAa,EAC3B,SACA,gBACA,iBACA,eACA,UACA,UACA,UACA,MACA,OACA,IACA,WACA,YACoB;CACpB,OACE,oBAACC,SAAa,MAAd;EACW;EACO;EACC;EACF;EACL;EACA;EACA;EACJ;EACC;EACH;EACO;EACX,yBAAsB;EAErB;CACgB,CAAA;AAEvB;AAEA,SAAgB,kBAAkB,EAAE,cAAc,OAAO,WAAW,UAAU,GAAG,SAAiC;CAChH,OACE,oBAACA,SAAa,WAAd;EAAwB,GAAI;EAAoB;EAAwB;EAAW,8BAA2B;EAC3G;CACqB,CAAA;AAE5B;AAEA,SAAgBD,gBAAc,EAAE,WAAW,UAAU,GAAG,SAA6B;CACnF,OACE,oBAACE,eAAD;EAAmB,GAAI;EAAkB;EAAW,0BAAuB;EACxE;CACgB,CAAA;AAEvB;AAEA,MAAaC,aAAW;CACtB,MAAM;CACN,WAAW;AACb"}
1
+ {"version":3,"file":"checkbox.js","names":["CheckboxGroup","BaseCheckbox","BaseCheckboxGroup","Checkbox"],"sources":["../../../src/particles/checkbox/checkbox.tsx"],"sourcesContent":["'use client';\nimport { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';\nimport { CheckboxGroup as BaseCheckboxGroup } from '@base-ui/react/checkbox-group';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, ReactNode, Ref } from 'react';\n\n// The twelve members below, over the span props Base UI's own `CheckboxRoot` already accepts, so\n// `ref`, `onBlur` and any `data-*` attribute reach the rendered host element through a rest spread.\n// `dangerouslySetInnerHTML` is excluded — the rest spread otherwise forwards it straight onto the\n// rendered `<span>`, and a schema-authored `page.json` can supply it with no allowlist in between.\nexport type CheckboxRootProps = Omit<\n ComponentPropsWithRef<'span'>,\n 'defaultValue' | 'defaultChecked' | 'onChange' | 'ref' | 'dangerouslySetInnerHTML'\n> & {\n /** The rendered host element is a span; Base UI types its forwarded ref as HTMLElement because `render` can replace it. */\n ref?: Ref<HTMLElement>;\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n indeterminate?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n name?: string;\n value?: string;\n id?: string;\n className?: string;\n children?: ReactNode;\n /** Id of the element this checkbox shows, hides or changes; forwarded to the `role=\"checkbox\"` element. */\n 'aria-controls'?: string;\n};\n\nexport type CheckboxIndicatorProps = ComponentPropsWithRef<'span'> & {\n keepMounted?: boolean;\n};\n\nexport type CheckboxGroupProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue'> & {\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (value: string[]) => void;\n allValues?: string[];\n disabled?: boolean;\n};\n\nexport const CheckboxRootDefinition = defineComponent<CheckboxRootProps>({\n name: 'CheckboxRoot',\n importPath: '@vtex/faststore/components',\n component: CheckboxRoot,\n editor: { label: 'Checkbox Root', category: 'action' },\n schema: {},\n guideline:\n 'Form checkbox that integrates with Field for labeling and validation. Requires a Checkbox.Indicator child for visual state. Use indeterminate for partial selection in nested lists.',\n});\n\nexport const CheckboxIndicatorDefinition = defineComponent<CheckboxIndicatorProps>({\n name: 'CheckboxIndicator',\n importPath: '@vtex/faststore/components',\n component: CheckboxIndicator,\n editor: { label: 'Checkbox Indicator', category: 'layout' },\n schema: {},\n guideline:\n 'Visual indicator inside Checkbox.Root showing checked/indeterminate state. Render a checkmark SVG as a child. Visible only when checked or indeterminate via data-checked/data-indeterminate.',\n});\n\nexport const CheckboxGroupDefinition = defineComponent<CheckboxGroupProps>({\n name: 'CheckboxGroup',\n importPath: '@vtex/faststore/components',\n component: CheckboxGroup,\n editor: { label: 'Checkbox Group', category: 'layout' },\n schema: {},\n guideline:\n 'Shared state container for a series of checkboxes. Use allValues to enable select-all behavior. Contains Checkbox.Root children with individual value props.',\n});\n\nexport function CheckboxRoot({\n checked,\n defaultChecked,\n onCheckedChange,\n indeterminate,\n disabled,\n readOnly,\n required,\n name,\n value,\n id,\n className,\n children,\n 'aria-controls': ariaControls,\n ref,\n ...props\n}: CheckboxRootProps) {\n return (\n <BaseCheckbox.Root\n {...props}\n ref={ref}\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={onCheckedChange}\n indeterminate={indeterminate}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n value={value}\n id={id}\n className={className}\n aria-controls={ariaControls}\n data-fs-checkbox-root=\"\"\n >\n {children}\n </BaseCheckbox.Root>\n );\n}\n\nexport function CheckboxIndicator({ keepMounted = false, className, children, ...props }: CheckboxIndicatorProps) {\n return (\n <BaseCheckbox.Indicator {...props} keepMounted={keepMounted} className={className} data-fs-checkbox-indicator=\"\">\n {children}\n </BaseCheckbox.Indicator>\n );\n}\n\nexport function CheckboxGroup({ className, children, ...props }: CheckboxGroupProps) {\n return (\n <BaseCheckboxGroup {...props} className={className} data-fs-checkbox-group=\"\">\n {children}\n </BaseCheckboxGroup>\n );\n}\n\nexport const Checkbox = {\n Root: CheckboxRoot,\n Indicator: CheckboxIndicator,\n};\n"],"mappings":";;;;;;;AA4CA,MAAa,yBAAyB,gBAAmC;CACvE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAiB,UAAU;CAAS;CACrD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,8BAA8B,gBAAwC;CACjF,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAsB,UAAU;CAAS;CAC1D,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,0BAA0B,gBAAoC;CACzE,MAAM;CACN,YAAY;CACZ,WAAWA;CACX,QAAQ;EAAE,OAAO;EAAkB,UAAU;CAAS;CACtD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,SAAgB,aAAa,EAC3B,SACA,gBACA,iBACA,eACA,UACA,UACA,UACA,MACA,OACA,IACA,WACA,UACA,iBAAiB,cACjB,KACA,GAAG,SACiB;CACpB,OACE,oBAACC,SAAa,MAAd;EACE,GAAI;EACC;EACI;EACO;EACC;EACF;EACL;EACA;EACA;EACJ;EACC;EACH;EACO;EACX,iBAAe;EACf,yBAAsB;EAErB;CACgB,CAAA;AAEvB;AAEA,SAAgB,kBAAkB,EAAE,cAAc,OAAO,WAAW,UAAU,GAAG,SAAiC;CAChH,OACE,oBAACA,SAAa,WAAd;EAAwB,GAAI;EAAoB;EAAwB;EAAW,8BAA2B;EAC3G;CACqB,CAAA;AAE5B;AAEA,SAAgBD,gBAAc,EAAE,WAAW,UAAU,GAAG,SAA6B;CACnF,OACE,oBAACE,eAAD;EAAmB,GAAI;EAAkB;EAAW,0BAAuB;EACxE;CACgB,CAAA;AAEvB;AAEA,MAAaC,aAAW;CACtB,MAAM;CACN,WAAW;AACb"}
@@ -1,28 +1,52 @@
1
1
  import { ComponentDefinition } from "../../core/dist/define-component.js";
2
2
  import "../../core/dist/index.js";
3
3
  import { applyMask } from "../shared/input-mask.js";
4
- import { ComponentPropsWithRef, FocusEvent } from "react";
4
+ import { ComponentPropsWithRef, FocusEvent, ReactNode, Ref } from "react";
5
5
  //#region src/particles/document-field/document-field.d.ts
6
6
  export type DocumentType = 'CPF';
7
+ type DocumentFieldRequirement = 'mandatory' | 'optional';
7
8
  export type DocumentSpec = {
8
9
  id: DocumentType;
9
10
  name: string;
10
11
  mask: string;
11
12
  validate: (value: string) => boolean;
12
13
  };
13
- export type DocumentFieldProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'value' | 'onChange' | 'onBlur'> & {
14
+ export type DocumentFieldProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'value' | 'onChange' | 'onBlur' | 'ref' | 'dangerouslySetInnerHTML'> & {
15
+ /** Unused on the bound path — react-hook-form owns the value. */
14
16
  value?: string;
17
+ /** Unused on the bound path — the field contract's `defaultValue` seeds it instead. */
15
18
  defaultValue?: string;
16
19
  onValueChange?: (value: string) => void;
17
20
  onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
18
21
  invalid?: boolean;
19
22
  errorMessage?: string;
23
+ /** Falls back to the field contract's `label` when bound. */
20
24
  label?: string;
25
+ /** Falls back to the field contract's `placeholder` when bound. */
21
26
  placeholder?: string;
27
+ /** Falls back to the field contract's `disabled` when bound. */
22
28
  disabled?: boolean;
23
- required?: boolean;
29
+ /**
30
+ * Raises the field to required, the same word `PhoneField` uses. It only ever raises: bound to a
31
+ * fieldset whose rule already says required, `'optional'` does not lower it. Left unset it is no
32
+ * opinion, which keeps CPF optional by recommendation.
33
+ */
34
+ requirement?: DocumentFieldRequirement;
24
35
  name?: string;
25
36
  documentType?: DocumentType;
37
+ /**
38
+ * Lands on the `<input>` `Field.Control` renders — not on the wrapper `<div>`, as it did before
39
+ * (a deliberate, source-breaking re-route: the previous ref pointed at an untabbable div). Composed
40
+ * with react-hook-form's own ref on the bound path.
41
+ */
42
+ ref?: Ref<HTMLInputElement>;
43
+ /**
44
+ * Given, replaces the default `Field.Label` + `DocumentFieldInput` + `Field.Error` anatomy — any
45
+ * order, any subset. `DocumentFieldInput` is the one part that carries the mask, the composed ref
46
+ * and the particle's own value/handlers; a composed generic `Field.Control` would call
47
+ * `useController` a second time for the same name (RFC's named, accepted double-binder hole).
48
+ */
49
+ children?: ReactNode;
26
50
  };
27
51
  /**
28
52
  * CPF check-digit validation, ported from the legacy `validateCPF`. Strips non-digits, requires
@@ -31,7 +55,15 @@ export type DocumentFieldProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValu
31
55
  */
32
56
  export declare function validateCPF(value: string): boolean;
33
57
  export declare const DOCUMENTS: Record<DocumentType, DocumentSpec>;
34
- /** True when `type` is a document type this build supports (lets a host gate the field by locale). */
58
+ /**
59
+ * True when `type` is a document type this build supports (lets a host gate the field by locale).
60
+ *
61
+ * `Object.hasOwn`, not the `in` operator: `in` walks the prototype chain, so `constructor`,
62
+ * `__proto__` and `toString` all satisfied it and were then trusted as a `DocumentType` by callers
63
+ * (`client-profile-fieldset.tsx` renders the field on the strength of this narrowing). The value is
64
+ * author-only — a literal written into `page.json`, never a runtime expression — so this is
65
+ * robustness rather than a reachable defect, but the narrowing should not be able to lie.
66
+ */
35
67
  export declare function isSupportedDocumentType(type: unknown): type is DocumentType;
36
68
  /**
37
69
  * Apply a document type's mask to raw input: strip non-digits for digit-only masks, then truncate to
@@ -54,8 +86,19 @@ export declare const DocumentFieldDefinition: ComponentDefinition<DocumentFieldP
54
86
  * when the check digit fails or when the host forces `invalid` (e.g. a server error surfaced by the
55
87
  * form that owns the write). It consumes no GraphQL and no domain context — value flows through
56
88
  * `value`/`defaultValue`/`onValueChange`, and `documentType` selects the mask + validator.
89
+ *
90
+ * Reads the field contract through `useField()` and `useFormContext()` and dispatches to a bound or an
91
+ * unbound sub-component — "bound" means both are present. Every react-hook-form hook lives in
92
+ * `BoundDocumentField`, so hook order never changes under a mounted component. Both sub-components
93
+ * render the same `DocumentFieldView`, so the two paths cannot drift into different DOM.
57
94
  */
58
- export declare function DocumentField({ value, defaultValue, onValueChange, onBlur, invalid, errorMessage, label, placeholder, disabled, required, name, documentType, className, ...props }: DocumentFieldProps): import("react/jsx-runtime").JSX.Element;
95
+ export declare function DocumentField(props: DocumentFieldProps): ReactNode;
96
+ export type DocumentFieldInputProps = {
97
+ className?: string;
98
+ };
99
+ export declare const DocumentFieldInputDefinition: ComponentDefinition<DocumentFieldInputProps>;
100
+ /** Renders the masked document `<input>`, reading its value/handlers/ref from the enclosing `DocumentField`. */
101
+ export declare function DocumentFieldInput({ className }: DocumentFieldInputProps): ReactNode;
59
102
  //#endregion
60
103
  export { applyMask };
61
104
  //# sourceMappingURL=document-field.d.ts.map