@planningcenter/tapestry 3.8.0-rc.0 → 3.8.0

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 (127) hide show
  1. package/dist/componentRegistration.js +7 -1
  2. package/dist/componentRegistration.js.map +1 -1
  3. package/dist/components/DataTable/DataTable.d.ts +31 -39
  4. package/dist/components/DataTable/DataTable.d.ts.map +1 -1
  5. package/dist/components/DataTable/DataTable.js +118 -23
  6. package/dist/components/DataTable/DataTable.js.map +1 -1
  7. package/dist/components/DataTable/DataTableColumn.d.ts +112 -0
  8. package/dist/components/DataTable/DataTableColumn.d.ts.map +1 -0
  9. package/dist/components/DataTable/DataTableColumnTypes.d.ts +60 -0
  10. package/dist/components/DataTable/DataTableColumnTypes.d.ts.map +1 -0
  11. package/dist/components/DataTable/DataTableColumnTypes.js +167 -0
  12. package/dist/components/DataTable/DataTableColumnTypes.js.map +1 -0
  13. package/dist/components/DataTable/DataTableRow.d.ts +2 -0
  14. package/dist/components/DataTable/DataTableRow.d.ts.map +1 -0
  15. package/dist/components/DataTable/DataTableRow.js +9 -0
  16. package/dist/components/DataTable/DataTableRow.js.map +1 -0
  17. package/dist/components/DataTable/index.d.ts +2 -1
  18. package/dist/components/DataTable/index.d.ts.map +1 -1
  19. package/dist/components/button-group/ButtonGroup.d.ts +35 -0
  20. package/dist/components/button-group/ButtonGroup.d.ts.map +1 -0
  21. package/dist/components/button-group/ButtonGroup.js +24 -0
  22. package/dist/components/button-group/ButtonGroup.js.map +1 -0
  23. package/dist/components/button-group/index.d.ts +4 -0
  24. package/dist/components/button-group/index.d.ts.map +1 -0
  25. package/dist/components/checkbox/Checkbox.d.ts +2 -2
  26. package/dist/components/checkbox/Checkbox.d.ts.map +1 -1
  27. package/dist/components/checkbox/Checkbox.js.map +1 -1
  28. package/dist/components/checkbox-group/CheckboxGroup.d.ts +1 -1
  29. package/dist/components/checkbox-group/CheckboxGroup.d.ts.map +1 -1
  30. package/dist/components/checkbox-group/CheckboxGroup.js.map +1 -1
  31. package/dist/components/combo-box/ComboBox.d.ts +1 -1
  32. package/dist/components/combo-box/ComboBox.d.ts.map +1 -1
  33. package/dist/components/combo-box/ComboBox.js.map +1 -1
  34. package/dist/components/date-picker/DatePicker.d.ts +2 -2
  35. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  36. package/dist/components/date-picker/DatePicker.js +39 -39
  37. package/dist/components/date-picker/DatePicker.js.map +1 -1
  38. package/dist/components/input/Input.d.ts +1 -1
  39. package/dist/components/input/Input.d.ts.map +1 -1
  40. package/dist/components/input/Input.js.map +1 -1
  41. package/dist/components/input-text-base/InputTextBase.d.ts +1 -1
  42. package/dist/components/input-text-base/InputTextBase.d.ts.map +1 -1
  43. package/dist/components/input-text-base/InputTextBase.js.map +1 -1
  44. package/dist/components/modal/Modal.d.ts +20 -0
  45. package/dist/components/modal/Modal.d.ts.map +1 -0
  46. package/dist/components/modal/Modal.js +113 -0
  47. package/dist/components/modal/Modal.js.map +1 -0
  48. package/dist/components/modal/ModalBody.d.ts +21 -0
  49. package/dist/components/modal/ModalBody.d.ts.map +1 -0
  50. package/dist/components/modal/ModalBody.js +18 -0
  51. package/dist/components/modal/ModalBody.js.map +1 -0
  52. package/dist/components/modal/ModalContext.d.ts +9 -0
  53. package/dist/components/modal/ModalContext.d.ts.map +1 -0
  54. package/dist/components/modal/ModalContext.js +6 -0
  55. package/dist/components/modal/ModalContext.js.map +1 -0
  56. package/dist/components/modal/ModalFooter.d.ts +22 -0
  57. package/dist/components/modal/ModalFooter.d.ts.map +1 -0
  58. package/dist/components/modal/ModalFooter.js +21 -0
  59. package/dist/components/modal/ModalFooter.js.map +1 -0
  60. package/dist/components/modal/ModalHeader.d.ts +23 -0
  61. package/dist/components/modal/ModalHeader.d.ts.map +1 -0
  62. package/dist/components/modal/ModalHeader.js +32 -0
  63. package/dist/components/modal/ModalHeader.js.map +1 -0
  64. package/dist/components/modal/index.d.ts +10 -0
  65. package/dist/components/modal/index.d.ts.map +1 -0
  66. package/dist/components/number-stepper/NumberStepper.d.ts +1 -1
  67. package/dist/components/number-stepper/NumberStepper.d.ts.map +1 -1
  68. package/dist/components/number-stepper/NumberStepper.js +11 -11
  69. package/dist/components/number-stepper/NumberStepper.js.map +1 -1
  70. package/dist/components/radio/Radio.d.ts +2 -2
  71. package/dist/components/radio/Radio.d.ts.map +1 -1
  72. package/dist/components/radio/Radio.js.map +1 -1
  73. package/dist/components/radio-group/RadioGroup.d.ts +2 -2
  74. package/dist/components/radio-group/RadioGroup.d.ts.map +1 -1
  75. package/dist/components/radio-group/RadioGroup.js.map +1 -1
  76. package/dist/components/select/Select.d.ts +1 -1
  77. package/dist/components/select/Select.d.ts.map +1 -1
  78. package/dist/components/select/Select.js +6 -6
  79. package/dist/components/select/Select.js.map +1 -1
  80. package/dist/components/select/SelectNative.js +6 -6
  81. package/dist/components/select/SelectNative.js.map +1 -1
  82. package/dist/components/select/SelectOptions.js +9 -9
  83. package/dist/components/select/SelectOptions.js.map +1 -1
  84. package/dist/components/select/SelectPopover.js +14 -14
  85. package/dist/components/select/SelectPopover.js.map +1 -1
  86. package/dist/components/text-area/TextArea.d.ts +1 -1
  87. package/dist/components/text-area/TextArea.d.ts.map +1 -1
  88. package/dist/components/text-area/TextArea.js.map +1 -1
  89. package/dist/components/time-field/TimeField.d.ts +1 -1
  90. package/dist/components/time-field/TimeField.d.ts.map +1 -1
  91. package/dist/components/time-field/TimeField.js.map +1 -1
  92. package/dist/components/toggle-switch/ToggleSwitch.d.ts +2 -2
  93. package/dist/components/toggle-switch/ToggleSwitch.d.ts.map +1 -1
  94. package/dist/components/toggle-switch/ToggleSwitch.js.map +1 -1
  95. package/dist/ext/@internationalized/date/dist/private/DateFormatter.js +139 -0
  96. package/dist/ext/@internationalized/date/dist/private/DateFormatter.js.map +1 -0
  97. package/dist/index.css +159 -4
  98. package/dist/index.css.map +1 -1
  99. package/dist/index.d.ts +2 -0
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +5 -0
  102. package/dist/index.js.map +1 -1
  103. package/dist/packages/tapestry-render/dist/buildComponent-Dr2UOgFa.js.map +1 -0
  104. package/dist/packages/tapestry-render/dist/index.js.map +1 -0
  105. package/dist/packages/tapestry-render/dist/legacy.js.map +1 -0
  106. package/dist/packages/tapestry-render/dist/registry.js.map +1 -0
  107. package/dist/reactRender.css +4422 -4178
  108. package/dist/reactRender.css.map +1 -1
  109. package/dist/reactRender.js +2 -2
  110. package/dist/reactRenderLegacy.css +4422 -4178
  111. package/dist/reactRenderLegacy.css.map +1 -1
  112. package/dist/reactRenderLegacy.js +2 -2
  113. package/dist/unstable.css +272 -28
  114. package/dist/unstable.css.map +1 -1
  115. package/dist/unstable.js +5 -0
  116. package/dist/unstable.js.map +1 -1
  117. package/dist/utilities/Icon.js +2 -2
  118. package/dist/utilities/Icon.js.map +1 -1
  119. package/package.json +2 -2
  120. package/dist/tapestry-render/dist/buildComponent-Dr2UOgFa.js.map +0 -1
  121. package/dist/tapestry-render/dist/index.js.map +0 -1
  122. package/dist/tapestry-render/dist/legacy.js.map +0 -1
  123. package/dist/tapestry-render/dist/registry.js.map +0 -1
  124. /package/dist/{tapestry-render → packages/tapestry-render}/dist/buildComponent-Dr2UOgFa.js +0 -0
  125. /package/dist/{tapestry-render → packages/tapestry-render}/dist/index.js +0 -0
  126. /package/dist/{tapestry-render → packages/tapestry-render}/dist/legacy.js +0 -0
  127. /package/dist/{tapestry-render → packages/tapestry-render}/dist/registry.js +0 -0
@@ -3,7 +3,7 @@ import { today as $ad063034c8620db8$export$d0bdf45af03a6ea3, getLocalTimeZone as
3
3
  import { parseDate as $58246871e4652552$export$6b862160d295c8e } from './../../ext/@internationalized/date/dist/private/string.js';
4
4
  import Icon from '../../utilities/Icon.js';
5
5
  import classNames from 'classnames';
6
- import React__default, { useState, useContext } from 'react';
6
+ import React, { useState, useContext } from 'react';
7
7
  import { CalendarStateContext } from 'react-aria-components/Calendar';
8
8
  import { DatePicker as DatePicker$1, Label, Group, DateInput, DateSegment, Button, Popover, Calendar, Text, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell } from 'react-aria-components/DatePicker';
9
9
  import { Dialog } from 'react-aria-components/Dialog';
@@ -27,7 +27,7 @@ function toCalendarDate(input) {
27
27
  return $58246871e4652552$export$6b862160d295c8e(input);
28
28
  }
29
29
  function DatePickerOverlay({ children, variant, }) {
30
- return (React__default.createElement("div", { "aria-label": `Select ${variant}`, "aria-modal": "true", className: `tds-date-picker-overlay tds-date-picker-overlay--${variant}`, role: "dialog" }, children));
30
+ return (React.createElement("div", { "aria-label": `Select ${variant}`, "aria-modal": "true", className: `tds-date-picker-overlay tds-date-picker-overlay--${variant}`, role: "dialog" }, children));
31
31
  }
32
32
  function DatePickerCalendarBody({ activeOverlay, setActiveOverlay, }) {
33
33
  // Read and drive Calendar's focused date through its state context. This
@@ -52,14 +52,14 @@ function DatePickerCalendarBody({ activeOverlay, setActiveOverlay, }) {
52
52
  state.setFocusedDate(new $2aaf608024c21ca1$export$99faa760c7908e4f(year, focusedDate.month, 1));
53
53
  setActiveOverlay(null);
54
54
  }
55
- return (React__default.createElement(React__default.Fragment, null,
56
- React__default.createElement("header", { className: "tds-date-picker-calendar-header" },
57
- React__default.createElement("div", { className: "tds-date-picker-calendar-heading" },
58
- React__default.createElement(Button, { "aria-expanded": activeOverlay === "month", "aria-haspopup": "dialog", className: "tds-date-picker-calendar-overlay-trigger", onPress: () => setActiveOverlay(activeOverlay === "month" ? null : "month"), slot: null }, longMonthFormatter.format(new Date(2000, focusedDate.month - 1, 1))),
59
- React__default.createElement(Button, { "aria-expanded": activeOverlay === "year", "aria-haspopup": "dialog", className: "tds-date-picker-calendar-overlay-trigger", onPress: () => setActiveOverlay(activeOverlay === "year" ? null : "year"), slot: null }, focusedDate.year)),
60
- activeOverlay ? (React__default.createElement(Button, { "aria-label": `Close ${activeOverlay} picker`, className: "tds-date-picker-calendar-nav", onPress: () => setActiveOverlay(null), slot: null },
61
- React__default.createElement(Icon, { "aria-hidden": true, symbol: "general#x" }))) : (React__default.createElement(React__default.Fragment, null,
62
- React__default.createElement(Button, { "aria-label": "Go to today", className: "tds-date-picker-calendar-nav tds-date-picker-calendar-nav--lg", style: {
55
+ return (React.createElement(React.Fragment, null,
56
+ React.createElement("header", { className: "tds-date-picker-calendar-header" },
57
+ React.createElement("div", { className: "tds-date-picker-calendar-heading" },
58
+ React.createElement(Button, { "aria-expanded": activeOverlay === "month", "aria-haspopup": "dialog", className: "tds-date-picker-calendar-overlay-trigger", onPress: () => setActiveOverlay(activeOverlay === "month" ? null : "month"), slot: null }, longMonthFormatter.format(new Date(2000, focusedDate.month - 1, 1))),
59
+ React.createElement(Button, { "aria-expanded": activeOverlay === "year", "aria-haspopup": "dialog", className: "tds-date-picker-calendar-overlay-trigger", onPress: () => setActiveOverlay(activeOverlay === "year" ? null : "year"), slot: null }, focusedDate.year)),
60
+ activeOverlay ? (React.createElement(Button, { "aria-label": `Close ${activeOverlay} picker`, className: "tds-date-picker-calendar-nav", onPress: () => setActiveOverlay(null), slot: null },
61
+ React.createElement(Icon, { "aria-hidden": true, symbol: "general#x" }))) : (React.createElement(React.Fragment, null,
62
+ React.createElement(Button, { "aria-label": "Go to today", className: "tds-date-picker-calendar-nav tds-date-picker-calendar-nav--lg", style: {
63
63
  visibility: focusedDate.month === today.month &&
64
64
  focusedDate.year === today.year
65
65
  ? "hidden"
@@ -68,30 +68,30 @@ function DatePickerCalendarBody({ activeOverlay, setActiveOverlay, }) {
68
68
  state.setFocusedDate(today);
69
69
  state.setFocused(true);
70
70
  }, slot: null },
71
- React__default.createElement("svg", { "aria-hidden": true, xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 16 16", className: "symbol" },
72
- React__default.createElement("path", { d: "M13.444 14.222H2.556V5.667h10.888zm0-12.444h-.777V.222h-1.556v1.556H4.889V.222H3.333v1.556h-.777a1.55 1.55 0 0 0-1.548 1.555L1 14.222a1.555 1.555 0 0 0 1.556 1.556h10.888A1.56 1.56 0 0 0 15 14.222V3.333a1.56 1.56 0 0 0-1.556-1.555" }),
73
- React__default.createElement("circle", { cx: "8", cy: "9.75", r: "2.25" }))),
74
- React__default.createElement(Button, { "aria-label": "Previous month", className: "tds-date-picker-calendar-nav", slot: "previous" },
75
- React__default.createElement(Icon, { "aria-hidden": true, symbol: "general#left-chevron" })),
76
- React__default.createElement(Button, { "aria-label": "Next month", className: "tds-date-picker-calendar-nav", slot: "next" },
77
- React__default.createElement(Icon, { "aria-hidden": true, symbol: "general#right-chevron" }))))),
78
- React__default.createElement("div", { className: "tds-date-picker-calendar-body" },
79
- activeOverlay === "month" && (React__default.createElement(DatePickerOverlay, { variant: "month" },
80
- React__default.createElement(ListBox, { "aria-label": "Months",
71
+ React.createElement("svg", { "aria-hidden": true, xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 16 16", className: "symbol" },
72
+ React.createElement("path", { d: "M13.444 14.222H2.556V5.667h10.888zm0-12.444h-.777V.222h-1.556v1.556H4.889V.222H3.333v1.556h-.777a1.55 1.55 0 0 0-1.548 1.555L1 14.222a1.555 1.555 0 0 0 1.556 1.556h10.888A1.56 1.56 0 0 0 15 14.222V3.333a1.56 1.56 0 0 0-1.556-1.555" }),
73
+ React.createElement("circle", { cx: "8", cy: "9.75", r: "2.25" }))),
74
+ React.createElement(Button, { "aria-label": "Previous month", className: "tds-date-picker-calendar-nav", slot: "previous" },
75
+ React.createElement(Icon, { "aria-hidden": true, symbol: "general#left-chevron" })),
76
+ React.createElement(Button, { "aria-label": "Next month", className: "tds-date-picker-calendar-nav", slot: "next" },
77
+ React.createElement(Icon, { "aria-hidden": true, symbol: "general#right-chevron" }))))),
78
+ React.createElement("div", { className: "tds-date-picker-calendar-body" },
79
+ activeOverlay === "month" && (React.createElement(DatePickerOverlay, { variant: "month" },
80
+ React.createElement(ListBox, { "aria-label": "Months",
81
81
  // eslint-disable-next-line jsx-a11y/no-autofocus -- focusing the active item on dialog open is required per ARIA authoring practices
82
82
  autoFocus: true, className: "tds-date-picker-overlay-list", disallowEmptySelection: true, escapeKeyBehavior: "none", layout: "grid", onSelectionChange: (keys) => handleOverlaySelectionChange(keys, handleMonthSelect), selectedKeys: [String(focusedDate.month - 1)], selectionMode: "single" }, MONTHS.map((i) => {
83
83
  const date = new Date(2000, i, 1);
84
84
  const shortMonth = shortMonthFormatter.format(date);
85
85
  const longMonth = longMonthFormatter.format(date);
86
- return (React__default.createElement(ListBoxItem, { className: "tds-date-picker-overlay-cell", id: String(i), key: i, "aria-label": longMonth, textValue: longMonth }, shortMonth));
86
+ return (React.createElement(ListBoxItem, { className: "tds-date-picker-overlay-cell", id: String(i), key: i, "aria-label": longMonth, textValue: longMonth }, shortMonth));
87
87
  })))),
88
- activeOverlay === "year" && (React__default.createElement(DatePickerOverlay, { variant: "year" },
89
- React__default.createElement(ListBox, { "aria-label": "Years",
88
+ activeOverlay === "year" && (React.createElement(DatePickerOverlay, { variant: "year" },
89
+ React.createElement(ListBox, { "aria-label": "Years",
90
90
  // eslint-disable-next-line jsx-a11y/no-autofocus -- focusing the active item on dialog open is required per ARIA authoring practices
91
- autoFocus: true, className: "tds-date-picker-overlay-list", disallowEmptySelection: true, escapeKeyBehavior: "none", layout: "grid", onSelectionChange: (keys) => handleOverlaySelectionChange(keys, handleYearSelect), selectedKeys: [String(focusedDate.year)], selectionMode: "single" }, YEARS.map((year) => (React__default.createElement(ListBoxItem, { className: "tds-date-picker-overlay-cell", id: String(year), key: year, textValue: String(year) }, year)))))),
92
- React__default.createElement(CalendarGrid, { className: "tds-date-picker-calendar-grid" },
93
- React__default.createElement(CalendarGridHeader, { className: "tds-date-picker-calendar-grid-header" }, (day) => (React__default.createElement(CalendarHeaderCell, { className: "tds-date-picker-calendar-header-cell" }, day))),
94
- React__default.createElement(CalendarGridBody, { className: "tds-date-picker-calendar-grid-body" }, (date) => (React__default.createElement(CalendarCell, { className: "tds-date-picker-calendar-cell-button", date: date })))))));
91
+ autoFocus: true, className: "tds-date-picker-overlay-list", disallowEmptySelection: true, escapeKeyBehavior: "none", layout: "grid", onSelectionChange: (keys) => handleOverlaySelectionChange(keys, handleYearSelect), selectedKeys: [String(focusedDate.year)], selectionMode: "single" }, YEARS.map((year) => (React.createElement(ListBoxItem, { className: "tds-date-picker-overlay-cell", id: String(year), key: year, textValue: String(year) }, year)))))),
92
+ React.createElement(CalendarGrid, { className: "tds-date-picker-calendar-grid" },
93
+ React.createElement(CalendarGridHeader, { className: "tds-date-picker-calendar-grid-header" }, (day) => (React.createElement(CalendarHeaderCell, { className: "tds-date-picker-calendar-header-cell" }, day))),
94
+ React.createElement(CalendarGridBody, { className: "tds-date-picker-calendar-grid-body" }, (date) => (React.createElement(CalendarCell, { className: "tds-date-picker-calendar-cell-button", date: date })))))));
95
95
  }
96
96
  /**
97
97
  * A date picker allows a user to select a particular date.
@@ -119,25 +119,25 @@ function DatePicker({ className, description, disabled, firstDayOfWeek, hideLabe
119
119
  "tds-field--lg": size === "lg",
120
120
  }, className);
121
121
  const [activeOverlay, setActiveOverlay] = useState(null);
122
- return (React__default.createElement(DatePicker$1, { ...restProps, "aria-label": hideLabel ? label : undefined, className: combinedClassName, isDateUnavailable: isDateUnavailable, isDisabled: disabled, isInvalid: invalid, isReadOnly: readOnly, isRequired: required, maxValue: convertedMax, minValue: convertedMin, onChange: onChange ?? undefined, onOpenChange: (isOpen) => {
122
+ return (React.createElement(DatePicker$1, { ...restProps, "aria-label": hideLabel ? label : undefined, className: combinedClassName, isDateUnavailable: isDateUnavailable, isDisabled: disabled, isInvalid: invalid, isReadOnly: readOnly, isRequired: required, maxValue: convertedMax, minValue: convertedMin, onChange: onChange ?? undefined, onOpenChange: (isOpen) => {
123
123
  if (!isOpen)
124
124
  setActiveOverlay(null);
125
125
  }, value: convertedValue },
126
- !hideLabel && React__default.createElement(Label, { className: "tds-field-label" }, label),
127
- React__default.createElement(Group, { className: "tds-field-control tds-date-picker-field" },
128
- React__default.createElement(DateInput, { className: "tds-date-picker-input" }, (segment) => (React__default.createElement(DateSegment, { className: segment.type === "literal"
126
+ !hideLabel && React.createElement(Label, { className: "tds-field-label" }, label),
127
+ React.createElement(Group, { className: "tds-field-control tds-date-picker-field" },
128
+ React.createElement(DateInput, { className: "tds-date-picker-input" }, (segment) => (React.createElement(DateSegment, { className: segment.type === "literal"
129
129
  ? "tds-field-date-segment-separator"
130
130
  : "tds-field-date-segment", segment: segment }))),
131
- React__default.createElement(Button, { className: "tds-btn tds-btn--infield tds-date-picker-button" },
132
- React__default.createElement(Icon, { "aria-hidden": true, symbol: "general#calendar" }))),
133
- React__default.createElement(Popover, { className: classNames("tds-date-picker-popover", {
131
+ React.createElement(Button, { className: "tds-btn tds-btn--infield tds-date-picker-button" },
132
+ React.createElement(Icon, { "aria-hidden": true, symbol: "general#calendar" }))),
133
+ React.createElement(Popover, { className: classNames("tds-date-picker-popover", {
134
134
  "tds-date-picker-popover--lg": size === "lg",
135
135
  }), offset: 2 },
136
- React__default.createElement(Dialog, null,
137
- React__default.createElement(Calendar, { className: "tds-date-picker-calendar", firstDayOfWeek: firstDayOfWeek },
138
- React__default.createElement(DatePickerCalendarBody, { activeOverlay: activeOverlay, setActiveOverlay: setActiveOverlay })))),
139
- description && (React__default.createElement(Text, { elementType: "p", className: "tds-field-description", slot: "description" },
140
- React__default.createElement(Icon, { "aria-hidden": true, className: "tds-field-description-invalid-icon", symbol: "general#exclamation-triangle" }),
136
+ React.createElement(Dialog, null,
137
+ React.createElement(Calendar, { className: "tds-date-picker-calendar", firstDayOfWeek: firstDayOfWeek },
138
+ React.createElement(DatePickerCalendarBody, { activeOverlay: activeOverlay, setActiveOverlay: setActiveOverlay })))),
139
+ description && (React.createElement(Text, { elementType: "p", className: "tds-field-description", slot: "description" },
140
+ React.createElement(Icon, { "aria-hidden": true, className: "tds-field-description-invalid-icon", symbol: "general#exclamation-triangle" }),
141
141
  description))));
142
142
  }
143
143
  DatePicker.displayName = "DatePicker";
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","sources":["../../../src/components/date-picker/DatePicker.tsx"],"sourcesContent":["import \"../button/btn.css\"\nimport \"../field/index.css\"\nimport \"./index.css\"\n\nimport {\n CalendarDate,\n type DateValue,\n getLocalTimeZone,\n parseDate,\n today as todayCalendar,\n} from \"@internationalized/date\"\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport classNames from \"classnames\"\nimport React, { type ReactNode, useContext, useState } from \"react\"\nimport { CalendarStateContext } from \"react-aria-components/Calendar\"\nimport {\n Button,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n DateInput,\n DatePicker as AriaDatePicker,\n type DatePickerProps as AriaDatePickerProps,\n DateSegment,\n Group,\n Label,\n Popover,\n Text,\n} from \"react-aria-components/DatePicker\"\nimport { Dialog } from \"react-aria-components/Dialog\"\nimport { ListBox, ListBoxItem } from \"react-aria-components/ListBox\"\n\nconst _today = todayCalendar(getLocalTimeZone())\nconst MONTHS = Array.from({ length: 12 }, (_, i) => i)\nconst YEARS = Array.from({ length: 131 }, (_, i) => _today.year - 100 + i)\nconst shortMonthFormatter = new Intl.DateTimeFormat(undefined, {\n month: \"short\",\n})\nconst longMonthFormatter = new Intl.DateTimeFormat(undefined, { month: \"long\" })\n\nexport type DatePickerSize = \"md\" | \"lg\"\n\nexport type DatePickerDateValue = DateValue | string\n\nfunction toCalendarDate(\n input: DatePickerDateValue | null | undefined\n): DateValue | null | undefined {\n if (input === null) return null\n if (input === undefined) return undefined\n\n if (typeof input === \"object\" && \"calendar\" in input) {\n return input\n }\n\n return parseDate(input)\n}\n\nexport interface DatePickerProps {\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: string\n /** Disables the input and calendar button. */\n disabled?: boolean\n /** Sets the first day of the week in the calendar. Defaults to locale-appropriate value. */\n firstDayOfWeek?: \"fri\" | \"mon\" | \"sat\" | \"sun\" | \"thu\" | \"tue\" | \"wed\"\n /** If `true`, the `label` text is rendered as an `aria-label` instead of a visible label element. */\n hideLabel?: boolean\n /** Whether the input is in an invalid state. */\n invalid?: boolean\n /** Callback that returns `true` for dates that should be visible but not selectable. */\n isDateUnavailable?: (date: DateValue) => boolean\n /** Accessible label for the field. */\n label: string\n /** Maximum selectable date. Accepts a DateValue or ISO date string. */\n max?: DatePickerDateValue\n /** Minimum selectable date. Accepts a DateValue or ISO date string. */\n min?: DatePickerDateValue\n /** Called when the selected date changes. */\n onChange?: (value: DateValue | null) => void\n /** If `true`, allows the value to be read but not changed. */\n readOnly?: boolean\n /** If `true`, appends an asterisk at the end of the label text. */\n required?: boolean\n /** The size of the date picker. */\n size?: DatePickerSize\n /** The controlled value. Accepts a DateValue or ISO date string. */\n value?: DatePickerDateValue | null\n}\n\ntype AriaDatePickerPropsToOmit =\n | \"children\"\n | \"defaultOpen\"\n | \"defaultValue\"\n | \"granularity\"\n | \"hideTimeZone\"\n | \"hourCycle\"\n | \"pageBehavior\"\n | \"placeholderValue\"\n | \"shouldCloseOnSelect\"\n | \"shouldForceLeadingZeros\"\n | \"slot\"\n\ntype AriaDatePickerPropsToInclude = \"isOpen\" | \"name\" | \"onOpenChange\"\n\nexport type DatePickerElementProps = CombineAriaPropsWithCustomProps<\n AriaDatePickerProps<DateValue>,\n DatePickerProps,\n AriaDatePickerPropsToOmit,\n AriaDatePickerPropsToInclude\n>\n\nfunction DatePickerOverlay({\n children,\n variant,\n}: {\n children: ReactNode\n variant: \"month\" | \"year\"\n}) {\n return (\n <div\n aria-label={`Select ${variant}`}\n aria-modal=\"true\"\n className={`tds-date-picker-overlay tds-date-picker-overlay--${variant}`}\n role=\"dialog\"\n >\n {children}\n </div>\n )\n}\n\nfunction DatePickerCalendarBody({\n activeOverlay,\n setActiveOverlay,\n}: {\n activeOverlay: \"month\" | \"year\" | null\n setActiveOverlay: (overlay: \"month\" | \"year\" | null) => void\n}) {\n // Read and drive Calendar's focused date through its state context. This\n // lets react-aria-components own the \"open to selected month\" behavior:\n // when the popover opens, Calendar mounts and auto-focuses the DatePicker's\n // current value (whether typed into the input segments or set via `value`).\n const state = useContext(CalendarStateContext)!\n const focusedDate = state.focusedDate\n const today = todayCalendar(getLocalTimeZone())\n\n function handleOverlaySelectionChange(\n keys: \"all\" | Set<number | string>,\n onSelect: (key: number) => void\n ) {\n if (keys === \"all\") return\n const [first] = Array.from(keys)\n if (first !== undefined) onSelect(Number(first))\n }\n\n function handleMonthSelect(monthIndex: number) {\n state.setFocusedDate(new CalendarDate(focusedDate.year, monthIndex + 1, 1))\n setActiveOverlay(null)\n }\n\n function handleYearSelect(year: number) {\n state.setFocusedDate(new CalendarDate(year, focusedDate.month, 1))\n setActiveOverlay(null)\n }\n\n return (\n <>\n <header className=\"tds-date-picker-calendar-header\">\n <div className=\"tds-date-picker-calendar-heading\">\n <Button\n aria-expanded={activeOverlay === \"month\"}\n aria-haspopup=\"dialog\"\n className=\"tds-date-picker-calendar-overlay-trigger\"\n onPress={() =>\n setActiveOverlay(activeOverlay === \"month\" ? null : \"month\")\n }\n slot={null}\n >\n {longMonthFormatter.format(\n new Date(2000, focusedDate.month - 1, 1)\n )}\n </Button>\n <Button\n aria-expanded={activeOverlay === \"year\"}\n aria-haspopup=\"dialog\"\n className=\"tds-date-picker-calendar-overlay-trigger\"\n onPress={() =>\n setActiveOverlay(activeOverlay === \"year\" ? null : \"year\")\n }\n slot={null}\n >\n {focusedDate.year}\n </Button>\n </div>\n {activeOverlay ? (\n <Button\n aria-label={`Close ${activeOverlay} picker`}\n className=\"tds-date-picker-calendar-nav\"\n onPress={() => setActiveOverlay(null)}\n slot={null}\n >\n <Icon aria-hidden symbol=\"general#x\" />\n </Button>\n ) : (\n <>\n <Button\n aria-label=\"Go to today\"\n className=\"tds-date-picker-calendar-nav tds-date-picker-calendar-nav--lg\"\n style={{\n visibility:\n focusedDate.month === today.month &&\n focusedDate.year === today.year\n ? \"hidden\"\n : undefined,\n }}\n onPress={() => {\n state.setFocusedDate(today)\n state.setFocused(true)\n }}\n slot={null}\n >\n {/* TODO: Add to icon library and use Icon once icon is decided on */}\n <svg\n aria-hidden\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"symbol\"\n >\n <path d=\"M13.444 14.222H2.556V5.667h10.888zm0-12.444h-.777V.222h-1.556v1.556H4.889V.222H3.333v1.556h-.777a1.55 1.55 0 0 0-1.548 1.555L1 14.222a1.555 1.555 0 0 0 1.556 1.556h10.888A1.56 1.56 0 0 0 15 14.222V3.333a1.56 1.56 0 0 0-1.556-1.555\" />\n <circle cx=\"8\" cy=\"9.75\" r=\"2.25\" />\n </svg>\n </Button>\n <Button\n aria-label=\"Previous month\"\n className=\"tds-date-picker-calendar-nav\"\n slot=\"previous\"\n >\n <Icon aria-hidden symbol=\"general#left-chevron\" />\n </Button>\n <Button\n aria-label=\"Next month\"\n className=\"tds-date-picker-calendar-nav\"\n slot=\"next\"\n >\n <Icon aria-hidden symbol=\"general#right-chevron\" />\n </Button>\n </>\n )}\n </header>\n <div className=\"tds-date-picker-calendar-body\">\n {activeOverlay === \"month\" && (\n <DatePickerOverlay variant=\"month\">\n <ListBox\n aria-label=\"Months\"\n // eslint-disable-next-line jsx-a11y/no-autofocus -- focusing the active item on dialog open is required per ARIA authoring practices\n autoFocus\n className=\"tds-date-picker-overlay-list\"\n disallowEmptySelection\n escapeKeyBehavior=\"none\"\n layout=\"grid\"\n onSelectionChange={(keys) =>\n handleOverlaySelectionChange(keys, handleMonthSelect)\n }\n selectedKeys={[String(focusedDate.month - 1)]}\n selectionMode=\"single\"\n >\n {MONTHS.map((i) => {\n const date = new Date(2000, i, 1)\n const shortMonth = shortMonthFormatter.format(date)\n const longMonth = longMonthFormatter.format(date)\n\n return (\n <ListBoxItem\n className=\"tds-date-picker-overlay-cell\"\n id={String(i)}\n key={i}\n aria-label={longMonth}\n textValue={longMonth}\n >\n {shortMonth}\n </ListBoxItem>\n )\n })}\n </ListBox>\n </DatePickerOverlay>\n )}\n {activeOverlay === \"year\" && (\n <DatePickerOverlay variant=\"year\">\n <ListBox\n aria-label=\"Years\"\n // eslint-disable-next-line jsx-a11y/no-autofocus -- focusing the active item on dialog open is required per ARIA authoring practices\n autoFocus\n className=\"tds-date-picker-overlay-list\"\n disallowEmptySelection\n escapeKeyBehavior=\"none\"\n layout=\"grid\"\n onSelectionChange={(keys) =>\n handleOverlaySelectionChange(keys, handleYearSelect)\n }\n selectedKeys={[String(focusedDate.year)]}\n selectionMode=\"single\"\n >\n {YEARS.map((year) => (\n <ListBoxItem\n className=\"tds-date-picker-overlay-cell\"\n id={String(year)}\n key={year}\n textValue={String(year)}\n >\n {year}\n </ListBoxItem>\n ))}\n </ListBox>\n </DatePickerOverlay>\n )}\n <CalendarGrid className=\"tds-date-picker-calendar-grid\">\n <CalendarGridHeader className=\"tds-date-picker-calendar-grid-header\">\n {(day) => (\n <CalendarHeaderCell className=\"tds-date-picker-calendar-header-cell\">\n {day}\n </CalendarHeaderCell>\n )}\n </CalendarGridHeader>\n <CalendarGridBody className=\"tds-date-picker-calendar-grid-body\">\n {(date) => (\n <CalendarCell\n className=\"tds-date-picker-calendar-cell-button\"\n date={date}\n />\n )}\n </CalendarGridBody>\n </CalendarGrid>\n </div>\n </>\n )\n}\n\n/**\n * A date picker allows a user to select a particular date.\n * The input supports keyboard entry of individual day, month, and year segments;\n * the calendar offers month and year quick-pick overlays plus a \"go to today\" shortcut.\n *\n * The date picker automatically displays the value and calendar from the user's locale,\n * and does not require a specific date format.\n *\n * Values are exchanged as `DateValue` from `@internationalized/date`, but\n * `value`, `min`, and `max` also accept ISO date strings (`\"YYYY-MM-DD\"`) for\n * convenience. Restrict the selectable range with `min`/`max`, or mark\n * individual dates as unavailable via `isDateUnavailable`.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-datepicker--docs | Storybook Documentation}\n * @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}\n */\nexport function DatePicker({\n className,\n description,\n disabled,\n firstDayOfWeek,\n hideLabel,\n invalid,\n isDateUnavailable,\n label,\n max,\n min,\n onChange,\n readOnly,\n required,\n size = \"md\",\n value,\n ...restProps\n}: DatePickerElementProps) {\n const convertedValue = toCalendarDate(value)\n const convertedMin = toCalendarDate(min) ?? undefined\n const convertedMax = toCalendarDate(max) ?? undefined\n\n const combinedClassName = classNames(\n \"tds-field tds-date-picker\",\n {\n \"tds-date-picker--lg\": size === \"lg\",\n \"tds-field--lg\": size === \"lg\",\n },\n className\n )\n\n const [activeOverlay, setActiveOverlay] = useState<\"month\" | \"year\" | null>(\n null\n )\n\n return (\n <AriaDatePicker\n {...restProps}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n isDateUnavailable={isDateUnavailable}\n isDisabled={disabled}\n isInvalid={invalid}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={convertedMax}\n minValue={convertedMin}\n onChange={onChange ?? undefined}\n onOpenChange={(isOpen) => {\n if (!isOpen) setActiveOverlay(null)\n }}\n value={convertedValue}\n >\n {!hideLabel && <Label className=\"tds-field-label\">{label}</Label>}\n <Group className=\"tds-field-control tds-date-picker-field\">\n <DateInput className=\"tds-date-picker-input\">\n {(segment) => (\n <DateSegment\n className={\n segment.type === \"literal\"\n ? \"tds-field-date-segment-separator\"\n : \"tds-field-date-segment\"\n }\n segment={segment}\n />\n )}\n </DateInput>\n <Button className=\"tds-btn tds-btn--infield tds-date-picker-button\">\n <Icon aria-hidden symbol=\"general#calendar\" />\n </Button>\n </Group>\n <Popover\n className={classNames(\"tds-date-picker-popover\", {\n \"tds-date-picker-popover--lg\": size === \"lg\",\n })}\n offset={2}\n >\n <Dialog>\n <Calendar\n className=\"tds-date-picker-calendar\"\n firstDayOfWeek={firstDayOfWeek}\n >\n <DatePickerCalendarBody\n activeOverlay={activeOverlay}\n setActiveOverlay={setActiveOverlay}\n />\n </Calendar>\n </Dialog>\n </Popover>\n {description && (\n <Text\n elementType=\"p\"\n className=\"tds-field-description\"\n slot=\"description\"\n >\n <Icon\n aria-hidden\n className=\"tds-field-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaDatePicker>\n )\n}\n\nDatePicker.displayName = \"DatePicker\"\n"],"names":["todayCalendar","getLocalTimeZone","parseDate","React","CalendarDate","AriaDatePicker"],"mappings":";;;;;;;;;;;AAoCA,MAAM,MAAM,GAAGA,yCAAa,CAACC,yCAAgB,EAAE,CAAC;AAChD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AACtD,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;AAC1E,MAAM,mBAAmB,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE;AAC7D,IAAA,KAAK,EAAE,OAAO;AACf,CAAA,CAAC;AACF,MAAM,kBAAkB,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAMhF,SAAS,cAAc,CACrB,KAA6C,EAAA;IAE7C,IAAI,KAAK,KAAK,IAAI;AAAE,QAAA,OAAO,IAAI;IAC/B,IAAI,KAAK,KAAK,SAAS;AAAE,QAAA,OAAO,SAAS;IAEzC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,UAAU,IAAI,KAAK,EAAE;AACpD,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,OAAOC,wCAAS,CAAC,KAAK,CAAC;AACzB;AAuDA,SAAS,iBAAiB,CAAC,EACzB,QAAQ,EACR,OAAO,GAIR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;sBACA,wBAAwB,EAE9B,OAAO,EAAE,OAAO,EAAA,CAChB,CACH,CACS;AACZ,YAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,iDAAiD,EAAA;AACjE,gBAAAA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAA,aAAA,EAAA,IAAA,EAAa,MAAM,EAAC,kBAAkB,EAAA,CAAG,CACvC,CACH;AACR,QAAAA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EACN,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE;gBAC/C,6BAA6B,EAAE,IAAI,KAAK,IAAI;aAC7C,CAAC,EACF,MAAM,EAAE,CAAC,EAAA;AAET,YAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA;gBACLA,cAAA,CAAA,aAAA,CAAC,QAAQ,IACP,SAAS,EAAC,0BAA0B,EACpC,cAAc,EAAE,cAAc,EAAA;AAE9B,oBAAAA,cAAA,CAAA,aAAA,CAAC,sBAAsB,EAAA,EACrB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAAA,CAClC,CACO,CACJ,CACD;AACT,QAAA,WAAW,KACVA,cAAA,CAAA,aAAA,CAAC,IAAI,IACH,WAAW,EAAC,GAAG,EACf,SAAS,EAAC,uBAAuB,EACjC,IAAI,EAAC,aAAa,EAAA;YAElBA,cAAA,CAAA,aAAA,CAAC,IAAI,yBAEH,SAAS,EAAC,oCAAoC,EAC9C,MAAM,EAAC,8BAA8B,EAAA,CACrC;AACD,YAAA,WAAW,CACP,CACR,CACc;AAErB;AAEA,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
1
+ {"version":3,"file":"DatePicker.js","sources":["../../../src/components/date-picker/DatePicker.tsx"],"sourcesContent":["import \"../button/btn.css\"\nimport \"../field/index.css\"\nimport \"./index.css\"\n\nimport {\n CalendarDate,\n type DateValue,\n getLocalTimeZone,\n parseDate,\n today as todayCalendar,\n} from \"@internationalized/date\"\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport classNames from \"classnames\"\nimport React, { type ReactNode, useContext, useState } from \"react\"\nimport { CalendarStateContext } from \"react-aria-components/Calendar\"\nimport {\n Button,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n DateInput,\n DatePicker as AriaDatePicker,\n type DatePickerProps as AriaDatePickerProps,\n DateSegment,\n Group,\n Label,\n Popover,\n Text,\n} from \"react-aria-components/DatePicker\"\nimport { Dialog } from \"react-aria-components/Dialog\"\nimport { ListBox, ListBoxItem } from \"react-aria-components/ListBox\"\n\nconst _today = todayCalendar(getLocalTimeZone())\nconst MONTHS = Array.from({ length: 12 }, (_, i) => i)\nconst YEARS = Array.from({ length: 131 }, (_, i) => _today.year - 100 + i)\nconst shortMonthFormatter = new Intl.DateTimeFormat(undefined, {\n month: \"short\",\n})\nconst longMonthFormatter = new Intl.DateTimeFormat(undefined, { month: \"long\" })\n\nexport type DatePickerSize = \"md\" | \"lg\"\n\nexport type DatePickerDateValue = DateValue | string\n\nfunction toCalendarDate(\n input: DatePickerDateValue | null | undefined\n): DateValue | null | undefined {\n if (input === null) return null\n if (input === undefined) return undefined\n\n if (typeof input === \"object\" && \"calendar\" in input) {\n return input\n }\n\n return parseDate(input)\n}\n\nexport interface DatePickerProps {\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: ReactNode\n /** Disables the input and calendar button. */\n disabled?: boolean\n /** Sets the first day of the week in the calendar. Defaults to locale-appropriate value. */\n firstDayOfWeek?: \"fri\" | \"mon\" | \"sat\" | \"sun\" | \"thu\" | \"tue\" | \"wed\"\n /** If `true`, the `label` text is rendered as an `aria-label` instead of a visible label element. */\n hideLabel?: boolean\n /** Whether the input is in an invalid state. */\n invalid?: boolean\n /** Callback that returns `true` for dates that should be visible but not selectable. */\n isDateUnavailable?: (date: DateValue) => boolean\n /** Accessible label for the field. */\n label: string\n /** Maximum selectable date. Accepts a DateValue or ISO date string. */\n max?: DatePickerDateValue\n /** Minimum selectable date. Accepts a DateValue or ISO date string. */\n min?: DatePickerDateValue\n /** Called when the selected date changes. */\n onChange?: (value: DateValue | null) => void\n /** If `true`, allows the value to be read but not changed. */\n readOnly?: boolean\n /** If `true`, appends an asterisk at the end of the label text. */\n required?: boolean\n /** The size of the date picker. */\n size?: DatePickerSize\n /** The controlled value. Accepts a DateValue or ISO date string. */\n value?: DatePickerDateValue | null\n}\n\ntype AriaDatePickerPropsToOmit =\n | \"children\"\n | \"defaultOpen\"\n | \"defaultValue\"\n | \"granularity\"\n | \"hideTimeZone\"\n | \"hourCycle\"\n | \"pageBehavior\"\n | \"placeholderValue\"\n | \"shouldCloseOnSelect\"\n | \"shouldForceLeadingZeros\"\n | \"slot\"\n\ntype AriaDatePickerPropsToInclude = \"isOpen\" | \"name\" | \"onOpenChange\"\n\nexport type DatePickerElementProps = CombineAriaPropsWithCustomProps<\n AriaDatePickerProps<DateValue>,\n DatePickerProps,\n AriaDatePickerPropsToOmit,\n AriaDatePickerPropsToInclude\n>\n\nfunction DatePickerOverlay({\n children,\n variant,\n}: {\n children: ReactNode\n variant: \"month\" | \"year\"\n}) {\n return (\n <div\n aria-label={`Select ${variant}`}\n aria-modal=\"true\"\n className={`tds-date-picker-overlay tds-date-picker-overlay--${variant}`}\n role=\"dialog\"\n >\n {children}\n </div>\n )\n}\n\nfunction DatePickerCalendarBody({\n activeOverlay,\n setActiveOverlay,\n}: {\n activeOverlay: \"month\" | \"year\" | null\n setActiveOverlay: (overlay: \"month\" | \"year\" | null) => void\n}) {\n // Read and drive Calendar's focused date through its state context. This\n // lets react-aria-components own the \"open to selected month\" behavior:\n // when the popover opens, Calendar mounts and auto-focuses the DatePicker's\n // current value (whether typed into the input segments or set via `value`).\n const state = useContext(CalendarStateContext)!\n const focusedDate = state.focusedDate\n const today = todayCalendar(getLocalTimeZone())\n\n function handleOverlaySelectionChange(\n keys: \"all\" | Set<number | string>,\n onSelect: (key: number) => void\n ) {\n if (keys === \"all\") return\n const [first] = Array.from(keys)\n if (first !== undefined) onSelect(Number(first))\n }\n\n function handleMonthSelect(monthIndex: number) {\n state.setFocusedDate(new CalendarDate(focusedDate.year, monthIndex + 1, 1))\n setActiveOverlay(null)\n }\n\n function handleYearSelect(year: number) {\n state.setFocusedDate(new CalendarDate(year, focusedDate.month, 1))\n setActiveOverlay(null)\n }\n\n return (\n <>\n <header className=\"tds-date-picker-calendar-header\">\n <div className=\"tds-date-picker-calendar-heading\">\n <Button\n aria-expanded={activeOverlay === \"month\"}\n aria-haspopup=\"dialog\"\n className=\"tds-date-picker-calendar-overlay-trigger\"\n onPress={() =>\n setActiveOverlay(activeOverlay === \"month\" ? null : \"month\")\n }\n slot={null}\n >\n {longMonthFormatter.format(\n new Date(2000, focusedDate.month - 1, 1)\n )}\n </Button>\n <Button\n aria-expanded={activeOverlay === \"year\"}\n aria-haspopup=\"dialog\"\n className=\"tds-date-picker-calendar-overlay-trigger\"\n onPress={() =>\n setActiveOverlay(activeOverlay === \"year\" ? null : \"year\")\n }\n slot={null}\n >\n {focusedDate.year}\n </Button>\n </div>\n {activeOverlay ? (\n <Button\n aria-label={`Close ${activeOverlay} picker`}\n className=\"tds-date-picker-calendar-nav\"\n onPress={() => setActiveOverlay(null)}\n slot={null}\n >\n <Icon aria-hidden symbol=\"general#x\" />\n </Button>\n ) : (\n <>\n <Button\n aria-label=\"Go to today\"\n className=\"tds-date-picker-calendar-nav tds-date-picker-calendar-nav--lg\"\n style={{\n visibility:\n focusedDate.month === today.month &&\n focusedDate.year === today.year\n ? \"hidden\"\n : undefined,\n }}\n onPress={() => {\n state.setFocusedDate(today)\n state.setFocused(true)\n }}\n slot={null}\n >\n {/* TODO: Add to icon library and use Icon once icon is decided on */}\n <svg\n aria-hidden\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"symbol\"\n >\n <path d=\"M13.444 14.222H2.556V5.667h10.888zm0-12.444h-.777V.222h-1.556v1.556H4.889V.222H3.333v1.556h-.777a1.55 1.55 0 0 0-1.548 1.555L1 14.222a1.555 1.555 0 0 0 1.556 1.556h10.888A1.56 1.56 0 0 0 15 14.222V3.333a1.56 1.56 0 0 0-1.556-1.555\" />\n <circle cx=\"8\" cy=\"9.75\" r=\"2.25\" />\n </svg>\n </Button>\n <Button\n aria-label=\"Previous month\"\n className=\"tds-date-picker-calendar-nav\"\n slot=\"previous\"\n >\n <Icon aria-hidden symbol=\"general#left-chevron\" />\n </Button>\n <Button\n aria-label=\"Next month\"\n className=\"tds-date-picker-calendar-nav\"\n slot=\"next\"\n >\n <Icon aria-hidden symbol=\"general#right-chevron\" />\n </Button>\n </>\n )}\n </header>\n <div className=\"tds-date-picker-calendar-body\">\n {activeOverlay === \"month\" && (\n <DatePickerOverlay variant=\"month\">\n <ListBox\n aria-label=\"Months\"\n // eslint-disable-next-line jsx-a11y/no-autofocus -- focusing the active item on dialog open is required per ARIA authoring practices\n autoFocus\n className=\"tds-date-picker-overlay-list\"\n disallowEmptySelection\n escapeKeyBehavior=\"none\"\n layout=\"grid\"\n onSelectionChange={(keys) =>\n handleOverlaySelectionChange(keys, handleMonthSelect)\n }\n selectedKeys={[String(focusedDate.month - 1)]}\n selectionMode=\"single\"\n >\n {MONTHS.map((i) => {\n const date = new Date(2000, i, 1)\n const shortMonth = shortMonthFormatter.format(date)\n const longMonth = longMonthFormatter.format(date)\n\n return (\n <ListBoxItem\n className=\"tds-date-picker-overlay-cell\"\n id={String(i)}\n key={i}\n aria-label={longMonth}\n textValue={longMonth}\n >\n {shortMonth}\n </ListBoxItem>\n )\n })}\n </ListBox>\n </DatePickerOverlay>\n )}\n {activeOverlay === \"year\" && (\n <DatePickerOverlay variant=\"year\">\n <ListBox\n aria-label=\"Years\"\n // eslint-disable-next-line jsx-a11y/no-autofocus -- focusing the active item on dialog open is required per ARIA authoring practices\n autoFocus\n className=\"tds-date-picker-overlay-list\"\n disallowEmptySelection\n escapeKeyBehavior=\"none\"\n layout=\"grid\"\n onSelectionChange={(keys) =>\n handleOverlaySelectionChange(keys, handleYearSelect)\n }\n selectedKeys={[String(focusedDate.year)]}\n selectionMode=\"single\"\n >\n {YEARS.map((year) => (\n <ListBoxItem\n className=\"tds-date-picker-overlay-cell\"\n id={String(year)}\n key={year}\n textValue={String(year)}\n >\n {year}\n </ListBoxItem>\n ))}\n </ListBox>\n </DatePickerOverlay>\n )}\n <CalendarGrid className=\"tds-date-picker-calendar-grid\">\n <CalendarGridHeader className=\"tds-date-picker-calendar-grid-header\">\n {(day) => (\n <CalendarHeaderCell className=\"tds-date-picker-calendar-header-cell\">\n {day}\n </CalendarHeaderCell>\n )}\n </CalendarGridHeader>\n <CalendarGridBody className=\"tds-date-picker-calendar-grid-body\">\n {(date) => (\n <CalendarCell\n className=\"tds-date-picker-calendar-cell-button\"\n date={date}\n />\n )}\n </CalendarGridBody>\n </CalendarGrid>\n </div>\n </>\n )\n}\n\n/**\n * A date picker allows a user to select a particular date.\n * The input supports keyboard entry of individual day, month, and year segments;\n * the calendar offers month and year quick-pick overlays plus a \"go to today\" shortcut.\n *\n * The date picker automatically displays the value and calendar from the user's locale,\n * and does not require a specific date format.\n *\n * Values are exchanged as `DateValue` from `@internationalized/date`, but\n * `value`, `min`, and `max` also accept ISO date strings (`\"YYYY-MM-DD\"`) for\n * convenience. Restrict the selectable range with `min`/`max`, or mark\n * individual dates as unavailable via `isDateUnavailable`.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-datepicker--docs | Storybook Documentation}\n * @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}\n */\nexport function DatePicker({\n className,\n description,\n disabled,\n firstDayOfWeek,\n hideLabel,\n invalid,\n isDateUnavailable,\n label,\n max,\n min,\n onChange,\n readOnly,\n required,\n size = \"md\",\n value,\n ...restProps\n}: DatePickerElementProps) {\n const convertedValue = toCalendarDate(value)\n const convertedMin = toCalendarDate(min) ?? undefined\n const convertedMax = toCalendarDate(max) ?? undefined\n\n const combinedClassName = classNames(\n \"tds-field tds-date-picker\",\n {\n \"tds-date-picker--lg\": size === \"lg\",\n \"tds-field--lg\": size === \"lg\",\n },\n className\n )\n\n const [activeOverlay, setActiveOverlay] = useState<\"month\" | \"year\" | null>(\n null\n )\n\n return (\n <AriaDatePicker\n {...restProps}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n isDateUnavailable={isDateUnavailable}\n isDisabled={disabled}\n isInvalid={invalid}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={convertedMax}\n minValue={convertedMin}\n onChange={onChange ?? undefined}\n onOpenChange={(isOpen) => {\n if (!isOpen) setActiveOverlay(null)\n }}\n value={convertedValue}\n >\n {!hideLabel && <Label className=\"tds-field-label\">{label}</Label>}\n <Group className=\"tds-field-control tds-date-picker-field\">\n <DateInput className=\"tds-date-picker-input\">\n {(segment) => (\n <DateSegment\n className={\n segment.type === \"literal\"\n ? \"tds-field-date-segment-separator\"\n : \"tds-field-date-segment\"\n }\n segment={segment}\n />\n )}\n </DateInput>\n <Button className=\"tds-btn tds-btn--infield tds-date-picker-button\">\n <Icon aria-hidden symbol=\"general#calendar\" />\n </Button>\n </Group>\n <Popover\n className={classNames(\"tds-date-picker-popover\", {\n \"tds-date-picker-popover--lg\": size === \"lg\",\n })}\n offset={2}\n >\n <Dialog>\n <Calendar\n className=\"tds-date-picker-calendar\"\n firstDayOfWeek={firstDayOfWeek}\n >\n <DatePickerCalendarBody\n activeOverlay={activeOverlay}\n setActiveOverlay={setActiveOverlay}\n />\n </Calendar>\n </Dialog>\n </Popover>\n {description && (\n <Text\n elementType=\"p\"\n className=\"tds-field-description\"\n slot=\"description\"\n >\n <Icon\n aria-hidden\n className=\"tds-field-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaDatePicker>\n )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B,EAAA,CAAG,CACvC,CACH;AACR,QAAA,KAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EACN,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE;gBAC/C,6BAA6B,EAAE,IAAI,KAAK,IAAI;aAC7C,CAAC,EACF,MAAM,EAAE,CAAC,EAAA;AAET,YAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA;gBACL,KAAA,CAAA,aAAA,CAAC,QAAQ,IACP,SAAS,EAAC,0BAA0B,EACpC,cAAc,EAAE,cAAc,EAAA;AAE9B,oBAAA,KAAA,CAAA,aAAA,CAAC,sBAAsB,EAAA,EACrB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAAA,CAClC,CACO,CACJ,CACD;AACT,QAAA,WAAW,KACV,KAAA,CAAA,aAAA,CAAC,IAAI,IACH,WAAW,EAAC,GAAG,EACf,SAAS,EAAC,uBAAuB,EACjC,IAAI,EAAC,aAAa,EAAA;YAElB,KAAA,CAAA,aAAA,CAAC,IAAI,yBAEH,SAAS,EAAC,oCAAoC,EAC9C,MAAM,EAAC,8BAA8B,EAAA,CACrC;AACD,YAAA,WAAW,CACP,CACR,CACc;AAErB;AAEA,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
@@ -6,7 +6,7 @@ interface InputBaseProps {
6
6
  /** If true, the input width grows to fit content. */
7
7
  autoWidth?: boolean;
8
8
  /** Helper text displayed below the input. Styled as an error when `invalid`. */
9
- description?: string;
9
+ description?: React.ReactNode;
10
10
  /** Whether the input is in an invalid state. */
11
11
  invalid?: boolean;
12
12
  /** If true, all text is selected when the input receives focus. */
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAIpB,OAAO,KAAK,EAAE,EAAc,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAEnE,MAAM,MAAM,SAAS,GAAG,I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,GACC,UAAU,CAAA;AAEZ;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,4FA2EjB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { InputTextBase } from \"@components/input-text-base\"\nimport classNames from \"classnames\"\nimport React, { forwardRef, type InputHTMLAttributes } from \"react\"\n\nexport type InputSize = \"lg\" | \"md\"\n\nexport type InputType =\n | \"email\"\n | \"number\"\n | \"password\"\n | \"search\"\n | \"tel\"\n | \"text\"\n | \"url\"\n\ninterface InputBaseProps {\n /** If true, the input width grows to fit content. */\n autoWidth?: boolean\n /** Helper text displayed below the input. Styled as an error when `invalid`. */\n description?: string\n /** Whether the input is in an invalid state. */\n invalid?: boolean\n /** If true, all text is selected when the input receives focus. */\n selectTextOnFocus?: boolean\n /** The size of the input. */\n size?: InputSize\n /** Supported input types — defaults to 'text' */\n type?: InputType\n}\n\ninterface InputWithVisibleLabel extends InputBaseProps {\n /** If true, the label is visually hidden and set as aria-label. */\n hideLabel?: false\n /** The label text for the input. */\n label: React.ReactNode\n}\n\ninterface InputWithHiddenLabel extends InputBaseProps {\n /** If true, the label is visually hidden and set as aria-label. */\n hideLabel: true\n /** The label text for the input. Must be a string when hidden. */\n label: string\n}\n\ninterface InputWithAriaLabelledBy extends InputBaseProps {\n \"aria-labelledby\": string\n hideLabel?: never\n label?: never\n}\n\nexport type InputProps =\n | InputWithAriaLabelledBy\n | InputWithHiddenLabel\n | InputWithVisibleLabel\n\n/**\n * Combines standard HTML input attributes with custom Input props.\n * Omits 'size' and 'type' from HTML attributes to avoid conflict with our strict types.\n */\nexport type InputElementProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n keyof InputProps | \"size\" | \"type\"\n> &\n InputProps\n\n/**\n * A text input component that renders as an HTML `<input>` with a label and\n * optional description. Supports the standard text-like input types\n * (`text`, `email`, `password`, `search`, `tel`, `url`, `number`), invalid\n * state, and `lg`/`md` sizing.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-input--docs | Storybook Documentation}\n * @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}\n */\nexport const Input = forwardRef<HTMLInputElement, InputElementProps>(\n function Input(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n autoComplete,\n autoWidth,\n className,\n description,\n hideLabel,\n id,\n invalid,\n label,\n onFocus,\n selectTextOnFocus,\n size = \"md\",\n type = \"text\",\n ...restProps\n }: InputElementProps,\n ref\n ) {\n const autoCompleteBlockingProps =\n autoComplete === \"off\"\n ? {\n \"data-1p-ignore\": true,\n \"data-bwignore\": true,\n \"data-form-type\": \"other\",\n \"data-lpignore\": true,\n }\n : {}\n\n const handleFocus = selectTextOnFocus\n ? (event: React.FocusEvent<HTMLInputElement>) => {\n try {\n event.currentTarget.select()\n } catch {\n // Some input types (e.g. number) do not support text selection.\n }\n onFocus?.(event)\n }\n : onFocus\n\n const wrapperClassName = classNames(\n { \"tds-input--auto-width\": autoWidth },\n className\n )\n\n return (\n <InputTextBase\n className={wrapperClassName}\n description={description}\n hideLabel={hideLabel || !!ariaLabelledBy}\n id={id}\n invalid={invalid}\n label={label}\n size={size}\n >\n {({ descriptionId, inputId }) => (\n <input\n {...restProps}\n {...autoCompleteBlockingProps}\n aria-describedby={descriptionId}\n aria-invalid={invalid || undefined}\n aria-label={hideLabel ? ariaLabel || (label as string) : ariaLabel}\n aria-labelledby={ariaLabelledBy}\n autoComplete={autoComplete}\n id={inputId}\n onFocus={handleFocus}\n ref={ref}\n type={type}\n />\n )}\n </InputTextBase>\n )\n }\n)\n\nInput.displayName = \"Input\"\n"],"names":["React"],"mappings":";;;;AAmEA;;;;;;;;;AASG;MACU,KAAK,GAAG,UAAU,CAC7B,SAAS,KAAK,CACZ,EACE,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,YAAY,EACZ,SA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AAG,EACR,IAAI,EAAE,IAAI,EAAA,CACV,CACH,CACa;AAEpB,CAAC;AAGH,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
1
+ {"version":3,"file":"Input.js","sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { InputTextBase } from \"@components/input-text-base\"\nimport classNames from \"classnames\"\nimport React, { forwardRef, type InputHTMLAttributes } from \"react\"\n\nexport type InputSize = \"lg\" | \"md\"\n\nexport type InputType =\n | \"email\"\n | \"number\"\n | \"password\"\n | \"search\"\n | \"tel\"\n | \"text\"\n | \"url\"\n\ninterface InputBaseProps {\n /** If true, the input width grows to fit content. */\n autoWidth?: boolean\n /** Helper text displayed below the input. Styled as an error when `invalid`. */\n description?: React.ReactNode\n /** Whether the input is in an invalid state. */\n invalid?: boolean\n /** If true, all text is selected when the input receives focus. */\n selectTextOnFocus?: boolean\n /** The size of the input. */\n size?: InputSize\n /** Supported input types — defaults to 'text' */\n type?: InputType\n}\n\ninterface InputWithVisibleLabel extends InputBaseProps {\n /** If true, the label is visually hidden and set as aria-label. */\n hideLabel?: false\n /** The label text for the input. */\n label: React.ReactNode\n}\n\ninterface InputWithHiddenLabel extends InputBaseProps {\n /** If true, the label is visually hidden and set as aria-label. */\n hideLabel: true\n /** The label text for the input. Must be a string when hidden. */\n label: string\n}\n\ninterface InputWithAriaLabelledBy extends InputBaseProps {\n \"aria-labelledby\": string\n hideLabel?: never\n label?: never\n}\n\nexport type InputProps =\n | InputWithAriaLabelledBy\n | InputWithHiddenLabel\n | InputWithVisibleLabel\n\n/**\n * Combines standard HTML input attributes with custom Input props.\n * Omits 'size' and 'type' from HTML attributes to avoid conflict with our strict types.\n */\nexport type InputElementProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n keyof InputProps | \"size\" | \"type\"\n> &\n InputProps\n\n/**\n * A text input component that renders as an HTML `<input>` with a label and\n * optional description. Supports the standard text-like input types\n * (`text`, `email`, `password`, `search`, `tel`, `url`, `number`), invalid\n * state, and `lg`/`md` sizing.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-input--docs | Storybook Documentation}\n * @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}\n */\nexport const Input = forwardRef<HTMLInputElement, InputElementProps>(\n function Input(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n autoComplete,\n autoWidth,\n className,\n description,\n hideLabel,\n id,\n invalid,\n label,\n onFocus,\n selectTextOnFocus,\n size = \"md\",\n type = \"text\",\n ...restProps\n }: InputElementProps,\n ref\n ) {\n const autoCompleteBlockingProps =\n autoComplete === \"off\"\n ? {\n \"data-1p-ignore\": true,\n \"data-bwignore\": true,\n \"data-form-type\": \"other\",\n \"data-lpignore\": true,\n }\n : {}\n\n const handleFocus = selectTextOnFocus\n ? (event: React.FocusEvent<HTMLInputElement>) => {\n try {\n event.currentTarget.select()\n } catch {\n // Some input types (e.g. number) do not support text selection.\n }\n onFocus?.(event)\n }\n : onFocus\n\n const wrapperClassName = classNames(\n { \"tds-input--auto-width\": autoWidth },\n className\n )\n\n return (\n <InputTextBase\n className={wrapperClassName}\n description={description}\n hideLabel={hideLabel || !!ariaLabelledBy}\n id={id}\n invalid={invalid}\n label={label}\n size={size}\n >\n {({ descriptionId, inputId }) => (\n <input\n {...restProps}\n {...autoCompleteBlockingProps}\n aria-describedby={descriptionId}\n aria-invalid={invalid || undefined}\n aria-label={hideLabel ? ariaLabel || (label as string) : ariaLabel}\n aria-labelledby={ariaLabelledBy}\n autoComplete={autoComplete}\n id={inputId}\n onFocus={handleFocus}\n ref={ref}\n type={type}\n />\n )}\n </InputTextBase>\n )\n }\n)\n\nInput.displayName = \"Input\"\n"],"names":["React"],"mappings":";;;;AAmEA;;;;;;;;;AASG;MACU,KAAK,GAAG,UAAU,CAC7B,SAAS,KAAK,CACZ,EACE,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EAC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ACpB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EAAA,CACV,CACH,CACa;AAEpB,CAAC;AAGH,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
@@ -4,7 +4,7 @@ interface InputTextBaseProps {
4
4
  descriptionId?: string;
5
5
  inputId: string;
6
6
  }) => React.ReactNode;
7
- description?: string;
7
+ description?: React.ReactNode;
8
8
  hideLabel?: boolean;
9
9
  id?: string;
10
10
  invalid?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"InputTextBase.d.ts","sourceRoot":"","sources":["../../../src/components/input-text-base/InputTextBase.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE;QAChB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,OAAO,EAAE,MAAM,CAAA;KAChB,KAAK,KAAK,CAAC,SAAS,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACnB;AAED,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,MAAM,kBAAkB,CACzB,GACC,kBAAkB,CAAA;AAEpB,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,WAAW,EACX,SAAS,EACT,EAAE,EACF,KAAK,EACL,OAAO,EACP,IAAI,GACL,EAAE,yBAAyB,qBAiC3B"}
1
+ {"version":3,"file":"InputTextBase.d.ts","sourceRoot":"","sources":["../../../src/components/input-text-base/InputTextBase.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE;QAChB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,OAAO,EAAE,MAAM,CAAA;KAChB,KAAK,KAAK,CAAC,SAAS,CAAA;IACrB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACnB;AAED,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,MAAM,kBAAkB,CACzB,GACC,kBAAkB,CAAA;AAEpB,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,WAAW,EACX,SAAS,EACT,EAAE,EACF,KAAK,EACL,OAAO,EACP,IAAI,GACL,EAAE,yBAAyB,qBAiC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"InputTextBase.js","sources":["../../../src/components/input-text-base/InputTextBase.tsx"],"sourcesContent":["import Icon from \"@utilities/Icon\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport * as React from \"react\"\n\ninterface InputTextBaseProps {\n children: (props: {\n descriptionId?: string\n inputId: string\n }) => React.ReactNode\n description?: string\n hideLabel?: boolean\n id?: string\n invalid?: boolean\n label?: React.ReactNode\n size?: \"md\" | \"lg\"\n}\n\nexport type InputTextBaseElementProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n keyof InputTextBaseProps\n> &\n InputTextBaseProps\n\nexport function InputTextBase({\n children,\n className,\n description,\n hideLabel,\n id,\n label,\n invalid,\n size,\n}: InputTextBaseElementProps) {\n const combinedClassName = classNames(\"tds-input\", className, {\n \"tds-input--invalid\": invalid,\n \"tds-input--lg\": size === \"lg\",\n })\n\n const stableId = useId()\n const inputId = id || `tds-input-${stableId}`\n const resolvedDescription =\n description || (invalid ? \"This field is required\" : undefined)\n const descriptionId = resolvedDescription\n ? `${inputId}-description`\n : undefined\n\n return (\n <div className={combinedClassName}>\n {!hideLabel && label ? <label htmlFor={inputId}>{label}</label> : null}\n {children({\n descriptionId,\n inputId,\n })}\n {resolvedDescription && (\n <p id={descriptionId} className=\"tds-input-description\">\n <Icon\n className=\"tds-input-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n aria-hidden\n />\n {resolvedDescription}\n </p>\n )}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;SAwBgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,WAAW,EACX,SAAS,EACT,EAAE,EACF,KAAK,EACL,OAAO,EACP,IAAI,GACsB,EAAA;AAC1B,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAAC,WAAW,EAAE,SAAS,EAAE;AAC3D,QAAA,oBAAoB,EAAE,OAAO;QAC7B,eAAe,EAAE,IAAI,KAAK,IAAI;AAC/B,KAAA,CAAC;AAEF,IAAA,MAAM,QAAQ,GAAG,KAAK,EAAE;AACxB,IAAA,MAAM,OAAO,GAAG,EAAE,IAAI,CAAA,UAAA,EAAa,QAAQ,EAAE;AAC7C,IAAA,MAAM,mBAAmB,GACvB,WAAW,KAAK,OAAO,GAAG,wBAAwB,GAAG,SAAS,CAAC;IACjE,MAAM,aAAa,GAAG;UAClB,CAAA,EAAG,OAAO,CAAA,YAAA;UACV,SAAS;AAEb,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,iBAAiB,EAAA;AAC9B,QAAA,CAAC,SAAS,IAAI,KAAK,GAAG,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,OAAO,EAAE,OAAO,IAAG,KAAK,CAAS,GAAG,IAAI;AACrE,QAAA,QAAQ,CAAC;YACR,aAAa;YACb,OAAO;SACR,CAAC;QACD,mBAAmB,KAClB,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAG,EAAE,EAAE,aAAa,EAAE,SAAS,EAAC,uBAAuB,EAAA;YACrD,KAAA,CAAA,aAAA,CAAC,IAAI,IACH,SAAS,EAAC,oCAAoC,EAC9C,MAAM,EAAC,8BAA8B,EAAA,aAAA,EAAA,IAAA,EAAA,CAErC;AACD,YAAA,mBAAmB,CAClB,CACL,CACG;AAEV;;;;"}
1
+ {"version":3,"file":"InputTextBase.js","sources":["../../../src/components/input-text-base/InputTextBase.tsx"],"sourcesContent":["import Icon from \"@utilities/Icon\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport * as React from \"react\"\n\ninterface InputTextBaseProps {\n children: (props: {\n descriptionId?: string\n inputId: string\n }) => React.ReactNode\n description?: React.ReactNode\n hideLabel?: boolean\n id?: string\n invalid?: boolean\n label?: React.ReactNode\n size?: \"md\" | \"lg\"\n}\n\nexport type InputTextBaseElementProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n keyof InputTextBaseProps\n> &\n InputTextBaseProps\n\nexport function InputTextBase({\n children,\n className,\n description,\n hideLabel,\n id,\n label,\n invalid,\n size,\n}: InputTextBaseElementProps) {\n const combinedClassName = classNames(\"tds-input\", className, {\n \"tds-input--invalid\": invalid,\n \"tds-input--lg\": size === \"lg\",\n })\n\n const stableId = useId()\n const inputId = id || `tds-input-${stableId}`\n const resolvedDescription =\n description || (invalid ? \"This field is required\" : undefined)\n const descriptionId = resolvedDescription\n ? `${inputId}-description`\n : undefined\n\n return (\n <div className={combinedClassName}>\n {!hideLabel && label ? <label htmlFor={inputId}>{label}</label> : null}\n {children({\n descriptionId,\n inputId,\n })}\n {resolvedDescription && (\n <p id={descriptionId} className=\"tds-input-description\">\n <Icon\n className=\"tds-input-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n aria-hidden\n />\n {resolvedDescription}\n </p>\n )}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;SAwBgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,WAAW,EACX,SAAS,EACT,EAAE,EACF,KAAK,EACL,OAAO,EACP,IAAI,GACsB,EAAA;AAC1B,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAAC,WAAW,EAAE,SAAS,EAAE;AAC3D,QAAA,oBAAoB,EAAE,OAAO;QAC7B,eAAe,EAAE,IAAI,KAAK,IAAI;AAC/B,KAAA,CAAC;AAEF,IAAA,MAAM,QAAQ,GAAG,KAAK,EAAE;AACxB,IAAA,MAAM,OAAO,GAAG,EAAE,IAAI,CAAA,UAAA,EAAa,QAAQ,EAAE;AAC7C,IAAA,MAAM,mBAAmB,GACvB,WAAW,KAAK,OAAO,GAAG,wBAAwB,GAAG,SAAS,CAAC;IACjE,MAAM,aAAa,GAAG;UAClB,CAAA,EAAG,OAAO,CAAA,YAAA;UACV,SAAS;AAEb,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,iBAAiB,EAAA;AAC9B,QAAA,CAAC,SAAS,IAAI,KAAK,GAAG,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,OAAO,EAAE,OAAO,IAAG,KAAK,CAAS,GAAG,IAAI;AACrE,QAAA,QAAQ,CAAC;YACR,aAAa;YACb,OAAO;SACR,CAAC;QACD,mBAAmB,KAClB,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAG,EAAE,EAAE,aAAa,EAAE,SAAS,EAAC,uBAAuB,EAAA;YACrD,KAAA,CAAA,aAAA,CAAC,IAAI,IACH,SAAS,EAAC,oCAAoC,EAC9C,MAAM,EAAC,8BAA8B,EAAA,aAAA,EAAA,IAAA,EAAA,CAErC;AACD,YAAA,mBAAmB,CAClB,CACL,CACG;AAEV;;;;"}
@@ -0,0 +1,20 @@
1
+ import "./index.css";
2
+ import React, { type DialogHTMLAttributes } from "react";
3
+ export type ModalSize = "sm" | "md" | "lg" | "xl";
4
+ export interface ModalProps {
5
+ /**
6
+ * A `<ModalHeader>` followed by a `<ModalBody>` and a `<ModalFooter>`.
7
+ */
8
+ children: React.ReactNode;
9
+ /** Default `false`. `true` enables Esc, backdrop-click, and the close button together. */
10
+ dismissible?: boolean;
11
+ /** Fires on every dismissal — Esc, backdrop, close button, or programmatic. */
12
+ onClose?: () => void;
13
+ /** Controls the dialog. Synced to `showModal()`/`close()`. */
14
+ open: boolean;
15
+ /** Default `'md'`. */
16
+ size?: ModalSize;
17
+ }
18
+ export type ModalElementProps = Omit<DialogHTMLAttributes<HTMLDialogElement>, keyof ModalProps | "onCancel"> & ModalProps;
19
+ export declare const Modal: React.ForwardRefExoticComponent<Omit<React.DialogHTMLAttributes<HTMLDialogElement>, keyof ModalProps | "onCancel"> & ModalProps & React.RefAttributes<HTMLDialogElement>>;
20
+ //# sourceMappingURL=Modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAIpB,OAAO,KAAK,EAAE,EACZ,KAAK,oBAAoB,EAK1B,MAAM,OAAO,CAAA;AAId,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAEjD,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,0FAA0F;IAC1F,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,8DAA8D;IAC9D,IAAI,EAAE,OAAO,CAAA;IACb,sBAAsB;IACtB,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,MAAM,UAAU,GAAG,UAAU,CAC9B,GACC,UAAU,CAAA;AAuCZ,eAAO,MAAM,KAAK,2KAyHjB,CAAA"}
@@ -0,0 +1,113 @@
1
+ import { useId } from '../../utilities/useId.js';
2
+ import classNames from 'classnames';
3
+ import React__default, { forwardRef, useRef, useEffect, useCallback } from 'react';
4
+ import { ModalContext } from './ModalContext.js';
5
+
6
+ function supportsRequestClose(dialogEl) {
7
+ return "requestClose" in dialogEl;
8
+ }
9
+ function supportsClosedBy(dialogEl) {
10
+ return "closedBy" in dialogEl;
11
+ }
12
+ function getActiveFocusableElement() {
13
+ return document.activeElement instanceof HTMLElement
14
+ ? document.activeElement
15
+ : null;
16
+ }
17
+ function isBackdropClick(event, dialogEl) {
18
+ return event.target === dialogEl;
19
+ }
20
+ function closeViaRequestOrDirect(dialogEl, dismissible) {
21
+ const dialogWithRequestClose = dialogEl;
22
+ if (supportsRequestClose(dialogEl)) {
23
+ dialogWithRequestClose.requestClose?.();
24
+ }
25
+ else if (dismissible) {
26
+ dialogEl.close();
27
+ }
28
+ }
29
+ const Modal = forwardRef(function Modal({ children, className, dismissible = false, id, onClose, open, size = "md", ...restProps }, ref) {
30
+ const stableId = useId();
31
+ const modalId = id || `tds-modal-${stableId}`;
32
+ const titleId = `${modalId}-title`;
33
+ const subtitleId = `${modalId}-subtitle`;
34
+ const dialogRef = useRef(null);
35
+ const previouslyFocusedElementRef = useRef(null);
36
+ const onCloseRef = useRef(onClose);
37
+ const requestClose = () => {
38
+ const dialogEl = dialogRef.current;
39
+ if (dialogEl)
40
+ closeViaRequestOrDirect(dialogEl, dismissible);
41
+ };
42
+ const contextValue = { dismissible, requestClose, subtitleId, titleId };
43
+ useEffect(() => {
44
+ onCloseRef.current = onClose;
45
+ }, [onClose]);
46
+ const setDialogRef = useCallback((element) => {
47
+ dialogRef.current = element;
48
+ if (typeof ref === "function") {
49
+ ref(element);
50
+ }
51
+ else if (ref) {
52
+ ref.current = element;
53
+ }
54
+ }, [ref]);
55
+ useEffect(() => {
56
+ const dialogEl = dialogRef.current;
57
+ if (!dialogEl)
58
+ return;
59
+ if (open && !dialogEl.open) {
60
+ previouslyFocusedElementRef.current = getActiveFocusableElement();
61
+ dialogEl.showModal();
62
+ }
63
+ else if (!open && dialogEl.open) {
64
+ dialogEl.close();
65
+ }
66
+ }, [open]);
67
+ useEffect(() => {
68
+ const dialogEl = dialogRef.current;
69
+ if (!dialogEl)
70
+ return;
71
+ const handleClose = () => {
72
+ onCloseRef.current?.();
73
+ previouslyFocusedElementRef.current?.focus();
74
+ previouslyFocusedElementRef.current = null;
75
+ };
76
+ const handleCancel = (event) => {
77
+ if (!dismissible)
78
+ event.preventDefault();
79
+ };
80
+ dialogEl.addEventListener("close", handleClose);
81
+ dialogEl.addEventListener("cancel", handleCancel);
82
+ let handleBackdropClick;
83
+ if (supportsClosedBy(dialogEl)) {
84
+ dialogEl.setAttribute("closedby", dismissible ? "any" : "none");
85
+ }
86
+ else {
87
+ handleBackdropClick = (event) => {
88
+ if (isBackdropClick(event, dialogEl)) {
89
+ closeViaRequestOrDirect(dialogEl, dismissible);
90
+ }
91
+ };
92
+ dialogEl.addEventListener("click", handleBackdropClick);
93
+ }
94
+ return () => {
95
+ dialogEl.removeEventListener("close", handleClose);
96
+ dialogEl.removeEventListener("cancel", handleCancel);
97
+ if (handleBackdropClick) {
98
+ dialogEl.removeEventListener("click", handleBackdropClick);
99
+ }
100
+ };
101
+ }, [dismissible]);
102
+ const combinedClassName = classNames("tds-modal", {
103
+ "tds-modal--lg": size === "lg",
104
+ "tds-modal--sm": size === "sm",
105
+ "tds-modal--xl": size === "xl",
106
+ }, className);
107
+ return (React__default.createElement("dialog", { ...restProps, ref: setDialogRef, "aria-describedby": subtitleId, "aria-labelledby": titleId, className: combinedClassName, id: modalId },
108
+ React__default.createElement(ModalContext.Provider, { value: contextValue }, children)));
109
+ });
110
+ Modal.displayName = "Modal";
111
+
112
+ export { Modal };
113
+ //# sourceMappingURL=Modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.js","sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, {\n type DialogHTMLAttributes,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n} from \"react\"\n\nimport { ModalContext } from \"./ModalContext\"\n\nexport type ModalSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\nexport interface ModalProps {\n /**\n * A `<ModalHeader>` followed by a `<ModalBody>` and a `<ModalFooter>`.\n */\n children: React.ReactNode\n /** Default `false`. `true` enables Esc, backdrop-click, and the close button together. */\n dismissible?: boolean\n /** Fires on every dismissal — Esc, backdrop, close button, or programmatic. */\n onClose?: () => void\n /** Controls the dialog. Synced to `showModal()`/`close()`. */\n open: boolean\n /** Default `'md'`. */\n size?: ModalSize\n}\n\nexport type ModalElementProps = Omit<\n DialogHTMLAttributes<HTMLDialogElement>,\n keyof ModalProps | \"onCancel\"\n> &\n ModalProps\n\ntype DialogWithRequestClose = HTMLDialogElement & {\n requestClose?: (returnValue?: string) => void\n}\n\nfunction supportsRequestClose(dialogEl: HTMLDialogElement): boolean {\n return \"requestClose\" in dialogEl\n}\n\nfunction supportsClosedBy(dialogEl: HTMLDialogElement): boolean {\n return \"closedBy\" in dialogEl\n}\n\nfunction getActiveFocusableElement(): HTMLElement | null {\n return document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null\n}\n\nfunction isBackdropClick(\n event: MouseEvent,\n dialogEl: HTMLDialogElement\n): boolean {\n return event.target === dialogEl\n}\n\nfunction closeViaRequestOrDirect(\n dialogEl: HTMLDialogElement,\n dismissible: boolean\n) {\n const dialogWithRequestClose = dialogEl as DialogWithRequestClose\n if (supportsRequestClose(dialogEl)) {\n dialogWithRequestClose.requestClose?.()\n } else if (dismissible) {\n dialogEl.close()\n }\n}\n\nexport const Modal = forwardRef<HTMLDialogElement, ModalElementProps>(\n function Modal(\n {\n children,\n className,\n dismissible = false,\n id,\n onClose,\n open,\n size = \"md\",\n ...restProps\n }: ModalElementProps,\n ref\n ) {\n const stableId = useId()\n const modalId = id || `tds-modal-${stableId}`\n const titleId = `${modalId}-title`\n const subtitleId = `${modalId}-subtitle`\n\n const dialogRef = useRef<HTMLDialogElement | null>(null)\n const previouslyFocusedElementRef = useRef<HTMLElement | null>(null)\n const onCloseRef = useRef(onClose)\n\n const requestClose = () => {\n const dialogEl = dialogRef.current\n if (dialogEl) closeViaRequestOrDirect(dialogEl, dismissible)\n }\n\n const contextValue = { dismissible, requestClose, subtitleId, titleId }\n\n useEffect(() => {\n onCloseRef.current = onClose\n }, [onClose])\n\n const setDialogRef = useCallback(\n (element: HTMLDialogElement | null) => {\n dialogRef.current = element\n if (typeof ref === \"function\") {\n ref(element)\n } else if (ref) {\n ref.current = element\n }\n },\n [ref]\n )\n\n useEffect(() => {\n const dialogEl = dialogRef.current\n if (!dialogEl) return\n\n if (open && !dialogEl.open) {\n previouslyFocusedElementRef.current = getActiveFocusableElement()\n dialogEl.showModal()\n } else if (!open && dialogEl.open) {\n dialogEl.close()\n }\n }, [open])\n\n useEffect(() => {\n const dialogEl = dialogRef.current\n if (!dialogEl) return\n\n const handleClose = () => {\n onCloseRef.current?.()\n previouslyFocusedElementRef.current?.focus()\n previouslyFocusedElementRef.current = null\n }\n\n const handleCancel = (event: Event) => {\n if (!dismissible) event.preventDefault()\n }\n\n dialogEl.addEventListener(\"close\", handleClose)\n dialogEl.addEventListener(\"cancel\", handleCancel)\n\n let handleBackdropClick: ((event: MouseEvent) => void) | undefined\n if (supportsClosedBy(dialogEl)) {\n dialogEl.setAttribute(\"closedby\", dismissible ? \"any\" : \"none\")\n } else {\n handleBackdropClick = (event) => {\n if (isBackdropClick(event, dialogEl)) {\n closeViaRequestOrDirect(dialogEl, dismissible)\n }\n }\n dialogEl.addEventListener(\"click\", handleBackdropClick)\n }\n\n return () => {\n dialogEl.removeEventListener(\"close\", handleClose)\n dialogEl.removeEventListener(\"cancel\", handleCancel)\n if (handleBackdropClick) {\n dialogEl.removeEventListener(\"click\", handleBackdropClick)\n }\n }\n }, [dismissible])\n\n const combinedClassName = classNames(\n \"tds-modal\",\n {\n \"tds-modal--lg\": size === \"lg\",\n \"tds-modal--sm\": size === \"sm\",\n \"tds-modal--xl\": size === \"xl\",\n },\n className\n )\n\n return (\n <dialog\n {...restProps}\n ref={setDialogRef}\n aria-describedby={subtitleId}\n aria-labelledby={titleId}\n className={combinedClassName}\n id={modalId}\n >\n <ModalContext.Provider value={contextValue}>\n {children}\n </ModalContext.Provider>\n </dialog>\n )\n }\n)\n\nModal.displayName = \"Modal\"\n"],"names":["React"],"mappings":";;;;;AAyCA,SAAS,oBAAoB,CAAC,QAA2B,EAAA;IACvD,OAAO,cAAc,IAAI,QAAQ;AACnC;AAEA,SAAS,gBAAgB,CAAC,QAA2B,EAAA;IACnD,OAAO,UAAU,IAAI,QAAQ;AAC/B;AAEA,SAAS,yBAAyB,GAAA;AAChC,IAAA,OAAO,QAAQ,CAAC,aAAa,YAAY;UACrC,QAAQ,CAAC;UACT,IAAI;AACV;AAEA,SAAS,eAAe,CACtB,KAAiB,EACjB,QAA2B,EAAA;AAE3B,IAAA,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;AAClC;AAEA,SAAS,uBAAuB,CAC9B,QAA2B,EAC3B,WAAoB,EAAA;IAEpB,MAAM,sBAAsB,GAAG,QAAkC;AACjE,IAAA,IAAI,oBAAoB,CAAC,QAAQ,CAAC,EAAE;AAClC,QAAA,sBAAsB,CAAC,YAAY,IAAI;IACzC;SAAO,IAAI,WAAW,EAAE;QACtB,QAAQ,CAAC,KAAK,EAAE;IAClB;AACF;AAEO,MAAM,KAAK,GAAG,UAAU,CAC7B,SAAS,KAAK,CACZ,EACE,QAAQ,EACR,SAAS,EACT,WAAW,GAAG,KAAK,EACnB,EAAE,EACF,OAAO,EACP,IAAI,EACJ,IAAI,GAAG,IAAI,EACX,GAAG,SAAS,EACM,EACpB,GAAG,EAAA;AAEH,IAA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MAAK;AACV,YAAA,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC;AAClD,YAAA,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC;YACpD,IAAI,mBAAmB,EAAE;AACvB,gBAAA,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,CAAC;YAC5D;AACF,QAAA,CAAC;AACH,IAAA,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;AAEjB,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,WAAW,EACX;QACE,eAAe,EAAE,IAAI,KAAK,IAAI;QAC9B,eAAe,EAAE,IAAI,KAAK,IAAI;QAC9B,eAAe,EAAE,IAAI,KAAK,IAAI;KAC/B,EACD,SAAS,CACV;AAED,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,GACM,SAAS,EACb,GAAG,EAAE,YAAY,EAAA,kBAAA,EACC,UAAU,EAAA,iBAAA,EACX,OAAO,EACxB,SAAS,EAAE,iBAAiB,EAC5B,EAAE,EAAE,OAAO,EAAA;AAEX,QAAAA,cAAA,CAAA,aAAA,CAAC,YAAY,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,YAAY,EAAA,EACvC,QAAQ,CACa,CACjB;AAEb,CAAC;AAGH,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
@@ -0,0 +1,21 @@
1
+ import "./index.css";
2
+ import React, { type HTMLAttributes } from "react";
3
+ export interface ModalBodyProps {
4
+ /** Content to display between the header and footer. */
5
+ children: React.ReactNode;
6
+ /** Default `false`. `true` removes the body's horizontal padding. */
7
+ fullWidth?: boolean;
8
+ }
9
+ export type ModalBodyElementProps = Omit<HTMLAttributes<HTMLDivElement>, keyof ModalBodyProps> & ModalBodyProps;
10
+ /**
11
+ * The body region of a `Modal` — holds arbitrary content between the header
12
+ * and footer.
13
+ *
14
+ * @component
15
+ * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}
16
+ */
17
+ export declare function ModalBody({ children, className, fullWidth, ...restProps }: ModalBodyElementProps): React.JSX.Element;
18
+ export declare namespace ModalBody {
19
+ var displayName: string;
20
+ }
21
+ //# sourceMappingURL=ModalBody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalBody.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ModalBody.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAGpB,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAElD,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,cAAc,CAAC,cAAc,CAAC,EAC9B,MAAM,cAAc,CACrB,GACC,cAAc,CAAA;AAEhB;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,GAAG,SAAS,EACb,EAAE,qBAAqB,qBAYvB;yBAjBe,SAAS"}
@@ -0,0 +1,18 @@
1
+ import classNames from 'classnames';
2
+ import React__default from 'react';
3
+
4
+ /**
5
+ * The body region of a `Modal` — holds arbitrary content between the header
6
+ * and footer.
7
+ *
8
+ * @component
9
+ * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}
10
+ */
11
+ function ModalBody({ children, className, fullWidth, ...restProps }) {
12
+ const combinedClassName = classNames("tds-modal-body", { "tds-modal-body--full-width": fullWidth }, className);
13
+ return (React__default.createElement("div", { ...restProps, className: combinedClassName }, children));
14
+ }
15
+ ModalBody.displayName = "ModalBody";
16
+
17
+ export { ModalBody };
18
+ //# sourceMappingURL=ModalBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalBody.js","sources":["../../../src/components/modal/ModalBody.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport classNames from \"classnames\"\nimport React, { type HTMLAttributes } from \"react\"\n\nexport interface ModalBodyProps {\n /** Content to display between the header and footer. */\n children: React.ReactNode\n /** Default `false`. `true` removes the body's horizontal padding. */\n fullWidth?: boolean\n}\n\nexport type ModalBodyElementProps = Omit<\n HTMLAttributes<HTMLDivElement>,\n keyof ModalBodyProps\n> &\n ModalBodyProps\n\n/**\n * The body region of a `Modal` — holds arbitrary content between the header\n * and footer.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}\n */\nexport function ModalBody({\n children,\n className,\n fullWidth,\n ...restProps\n}: ModalBodyElementProps) {\n const combinedClassName = classNames(\n \"tds-modal-body\",\n { \"tds-modal-body--full-width\": fullWidth },\n className\n )\n\n return (\n <div {...restProps} className={combinedClassName}>\n {children}\n </div>\n )\n}\n\nModalBody.displayName = \"ModalBody\"\n"],"names":["React"],"mappings":";;;AAkBA;;;;;;AAMG;AACG,SAAU,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,GAAG,SAAS,EACU,EAAA;AACtB,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,gBAAgB,EAChB,EAAE,4BAA4B,EAAE,SAAS,EAAE,EAC3C,SAAS,CACV;IAED,QACEA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAS,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAA,EAC7C,QAAQ,CACL;AAEV;AAEA,SAAS,CAAC,WAAW,GAAG,WAAW;;;;"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface ModalContextValue {
3
+ dismissible: boolean;
4
+ requestClose: () => void;
5
+ subtitleId: string;
6
+ titleId: string;
7
+ }
8
+ export declare const ModalContext: React.Context<ModalContextValue | null>;
9
+ //# sourceMappingURL=ModalContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalContext.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ModalContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,OAAO,CAAA;IACpB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,YAAY,yCAAsD,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React__default from 'react';
2
+
3
+ const ModalContext = React__default.createContext(null);
4
+
5
+ export { ModalContext };
6
+ //# sourceMappingURL=ModalContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalContext.js","sources":["../../../src/components/modal/ModalContext.tsx"],"sourcesContent":["import React from \"react\"\n\nexport interface ModalContextValue {\n dismissible: boolean\n requestClose: () => void\n subtitleId: string\n titleId: string\n}\n\nexport const ModalContext = React.createContext<ModalContextValue | null>(null)\n"],"names":["React"],"mappings":";;AASO,MAAM,YAAY,GAAGA,cAAK,CAAC,aAAa,CAA2B,IAAI;;;;"}