@planningcenter/tapestry 4.11.0 → 4.12.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.
- package/dist/components/DataTable/CollectionEditorsLazy.js +2 -1
- package/dist/components/DataTable/CollectionEditorsLazy.js.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +49 -14
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +32 -24
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/DataTable/DeleteSavedViewAlertDialog.d.ts +14 -0
- package/dist/components/DataTable/DeleteSavedViewAlertDialog.d.ts.map +1 -0
- package/dist/components/DataTable/DeleteSavedViewAlertDialog.js +10 -0
- package/dist/components/DataTable/DeleteSavedViewAlertDialog.js.map +1 -0
- package/dist/components/DataTable/ManageSavedViewsButton.d.ts +4 -1
- package/dist/components/DataTable/ManageSavedViewsButton.d.ts.map +1 -1
- package/dist/components/DataTable/ManageSavedViewsButton.js +3 -7
- package/dist/components/DataTable/ManageSavedViewsButton.js.map +1 -1
- package/dist/components/DataTable/ManageSavedViewsModal.d.ts +11 -1
- package/dist/components/DataTable/ManageSavedViewsModal.d.ts.map +1 -1
- package/dist/components/DataTable/ManageSavedViewsModal.js +265 -5
- package/dist/components/DataTable/ManageSavedViewsModal.js.map +1 -1
- package/dist/components/DataTable/ManageSavedViewsModal.module.css.js +4 -0
- package/dist/components/DataTable/ManageSavedViewsModal.module.css.js.map +1 -0
- package/dist/components/DataTable/NewSavedViewModal.d.ts +4 -1
- package/dist/components/DataTable/NewSavedViewModal.d.ts.map +1 -1
- package/dist/components/DataTable/NewSavedViewModal.js.map +1 -1
- package/dist/components/DataTable/ResultsCount.d.ts +9 -0
- package/dist/components/DataTable/ResultsCount.d.ts.map +1 -1
- package/dist/components/DataTable/ResultsCount.js +1 -1
- package/dist/components/DataTable/ResultsCount.js.map +1 -1
- package/dist/components/DataTable/SavedViewsBar.d.ts +14 -6
- package/dist/components/DataTable/SavedViewsBar.d.ts.map +1 -1
- package/dist/components/DataTable/SavedViewsBar.js +176 -45
- package/dist/components/DataTable/SavedViewsBar.js.map +1 -1
- package/dist/components/DataTable/TableActions.d.ts.map +1 -1
- package/dist/components/DataTable/TableActions.js +4 -6
- package/dist/components/DataTable/TableActions.js.map +1 -1
- package/dist/components/DataTable/ViewSettingsToggle.d.ts.map +1 -1
- package/dist/components/DataTable/ViewSettingsToggle.js +2 -4
- package/dist/components/DataTable/ViewSettingsToggle.js.map +1 -1
- package/dist/components/DataTable/index.d.ts +1 -1
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DataTable/savedViews.d.ts +40 -15
- package/dist/components/DataTable/savedViews.d.ts.map +1 -1
- package/dist/components/DataTable/savedViews.js +85 -6
- package/dist/components/DataTable/savedViews.js.map +1 -1
- package/dist/components/DataTable/useActiveSavedView.d.ts +1 -1
- package/dist/components/DataTable/useActiveSavedView.d.ts.map +1 -1
- package/dist/components/DataTable/useActiveSavedView.js +9 -3
- package/dist/components/DataTable/useActiveSavedView.js.map +1 -1
- package/dist/components/DataTable/useFilterAnnouncement.d.ts +24 -0
- package/dist/components/DataTable/useFilterAnnouncement.d.ts.map +1 -0
- package/dist/components/DataTable/useFilterAnnouncement.js +49 -0
- package/dist/components/DataTable/useFilterAnnouncement.js.map +1 -0
- package/dist/components/DataTable/useUpdateSavedViewName.d.ts +7 -0
- package/dist/components/DataTable/useUpdateSavedViewName.d.ts.map +1 -0
- package/dist/components/DataTable/useUpdateSavedViewName.js +12 -0
- package/dist/components/DataTable/useUpdateSavedViewName.js.map +1 -0
- package/dist/components/button/ActionsDropdownIconButton.d.ts +18 -9
- package/dist/components/button/ActionsDropdownIconButton.d.ts.map +1 -1
- package/dist/components/button/ActionsDropdownIconButton.js +5 -2
- package/dist/components/button/ActionsDropdownIconButton.js.map +1 -1
- package/dist/components/button/BaseButton.d.ts.map +1 -1
- package/dist/components/button/BaseButton.js +2 -1
- package/dist/components/button/BaseButton.js.map +1 -1
- package/dist/components/button/DropdownIconButton.d.ts +4 -5
- package/dist/components/button/DropdownIconButton.d.ts.map +1 -1
- package/dist/components/button/DropdownIconButton.js +2 -1
- package/dist/components/button/DropdownIconButton.js.map +1 -1
- package/dist/components/button/IconButton.d.ts +31 -10
- package/dist/components/button/IconButton.d.ts.map +1 -1
- package/dist/components/button/IconButton.js +8 -2
- package/dist/components/button/IconButton.js.map +1 -1
- package/dist/components/button/ToggleIconButton.d.ts +4 -1
- package/dist/components/button/ToggleIconButton.d.ts.map +1 -1
- package/dist/components/button/ToggleIconButton.js +1 -0
- package/dist/components/button/ToggleIconButton.js.map +1 -1
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/index.d.ts.map +1 -1
- package/dist/components/combo-box/ComboBox.d.ts +8 -0
- package/dist/components/combo-box/ComboBox.d.ts.map +1 -1
- package/dist/components/combo-box/ComboBox.js +31 -5
- package/dist/components/combo-box/ComboBox.js.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +18 -14
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/internal/LoadingAnnouncement.d.ts +11 -0
- package/dist/components/internal/LoadingAnnouncement.d.ts.map +1 -0
- package/dist/components/internal/LoadingAnnouncement.js +21 -0
- package/dist/components/internal/LoadingAnnouncement.js.map +1 -0
- package/dist/components/internal/alert-dialog/AlertDialog.d.ts +56 -0
- package/dist/components/internal/alert-dialog/AlertDialog.d.ts.map +1 -0
- package/dist/components/internal/alert-dialog/AlertDialog.js +68 -0
- package/dist/components/internal/alert-dialog/AlertDialog.js.map +1 -0
- package/dist/components/internal/alert-dialog/index.d.ts +5 -0
- package/dist/components/internal/alert-dialog/index.d.ts.map +1 -0
- package/dist/components/internal/index.d.ts +1 -0
- package/dist/components/internal/index.d.ts.map +1 -1
- package/dist/components/internal/tooltip/Tooltip.d.ts +13 -5
- package/dist/components/internal/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/internal/tooltip/Tooltip.js +63 -8
- package/dist/components/internal/tooltip/Tooltip.js.map +1 -1
- package/dist/components/internal/tooltip/TooltipTriggerContext.d.ts +3 -3
- package/dist/components/internal/tooltip/TooltipTriggerContext.d.ts.map +1 -1
- package/dist/components/internal/tooltip/TooltipTriggerContext.js +1 -1
- package/dist/components/internal/tooltip/TooltipTriggerContext.js.map +1 -1
- package/dist/components/internal/tooltip/index.d.ts +1 -1
- package/dist/components/internal/tooltip/index.d.ts.map +1 -1
- package/dist/components/link/BaseLink.d.ts.map +1 -1
- package/dist/components/link/BaseLink.js +15 -3
- package/dist/components/link/BaseLink.js.map +1 -1
- package/dist/components/link/IconLink.d.ts +28 -290
- package/dist/components/link/IconLink.d.ts.map +1 -1
- package/dist/components/link/IconLink.js +9 -2
- package/dist/components/link/IconLink.js.map +1 -1
- package/dist/components/page-header/defineElements.js +1 -1
- package/dist/components/pane/Pane.d.ts +1 -1
- package/dist/components/pane/Pane.js +1 -1
- package/dist/components/pane/Pane.js.map +1 -1
- package/dist/components/pane/PaneBody.d.ts +1 -1
- package/dist/components/pane/PaneBody.js +1 -1
- package/dist/components/pane/PaneBody.js.map +1 -1
- package/dist/components/pane/PaneDivider.d.ts +6 -3
- package/dist/components/pane/PaneDivider.d.ts.map +1 -1
- package/dist/components/pane/PaneDivider.js +3 -3
- package/dist/components/pane/PaneDivider.js.map +1 -1
- package/dist/components/pane/PaneFooter.d.ts +1 -1
- package/dist/components/pane/PaneFooter.js +1 -1
- package/dist/components/pane/PaneFooter.js.map +1 -1
- package/dist/components/pane/PaneHeader.d.ts +1 -1
- package/dist/components/pane/PaneHeader.js +1 -1
- package/dist/components/pane/PaneHeader.js.map +1 -1
- package/dist/components/pane/PaneHeaderActions.d.ts +1 -1
- package/dist/components/pane/PaneHeaderActions.js +1 -1
- package/dist/components/pane/PaneHeaderActions.js.map +1 -1
- package/dist/components/sidenav/defineElements.js +1 -1
- package/dist/components/time-field/TimeField.d.ts.map +1 -1
- package/dist/components/time-field/TimeField.js +7 -3
- package/dist/components/time-field/TimeField.js.map +1 -1
- package/dist/index.css +169 -27
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/{p-np7vhMVg.js → p-A1JK45WV.js} +3 -3
- package/dist/packages/tapestry-wc/dist/components/p-A1JK45WV.js.map +1 -0
- package/dist/packages/tapestry-wc/dist/components/{p-BVvtAaVT.js → p-BbuNAv9q.js} +3 -3
- package/dist/packages/tapestry-wc/dist/components/p-BbuNAv9q.js.map +1 -0
- package/dist/packages/tapestry-wc/dist/components/{p-B2xqMgNQ.js → p-CBFtMIxJ.js} +2 -2
- package/dist/packages/tapestry-wc/dist/components/p-CBFtMIxJ.js.map +1 -0
- package/dist/packages/tapestry-wc/dist/components/{p-Rn6lOB18.js → p-CY_DC4d_.js} +3 -3
- package/dist/packages/tapestry-wc/dist/components/p-CY_DC4d_.js.map +1 -0
- package/dist/packages/tapestry-wc/dist/components/{p-6NO22Vi_.js → p-DNHgMtxw.js} +2 -2
- package/dist/packages/tapestry-wc/dist/components/p-DNHgMtxw.js.map +1 -0
- package/dist/packages/tapestry-wc/dist/components/tds-page-header-nav.js +2 -2
- package/dist/packages/tapestry-wc/dist/components/tds-page-header-nav.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-page-header.js +3 -3
- package/dist/packages/tapestry-wc/dist/components/tds-page-header.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-item.js +3 -3
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-item.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-responsive-header.js +2 -2
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-responsive-header.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-section.js +3 -3
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-section.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav.js +5 -5
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav.js.map +1 -1
- package/dist/reactRender.css +756 -574
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +756 -574
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/tapestryMount.css +756 -574
- package/dist/tapestryMount.css.map +1 -1
- package/dist/tapestryMountLegacy.css +756 -574
- package/dist/tapestryMountLegacy.css.map +1 -1
- package/dist/unstable.css +309 -127
- package/dist/unstable.css.map +1 -1
- package/dist/unstable.d.ts +0 -1
- package/dist/unstable.d.ts.map +1 -1
- package/dist/unstable.js +6 -6
- package/dist/utilities/dateFieldLocale.d.ts +2 -0
- package/dist/utilities/dateFieldLocale.d.ts.map +1 -0
- package/dist/utilities/dateFieldLocale.js +32 -0
- package/dist/utilities/dateFieldLocale.js.map +1 -0
- package/dist/utilities/useAnnounce.d.ts +22 -0
- package/dist/utilities/useAnnounce.d.ts.map +1 -0
- package/dist/utilities/useAnnounce.js +27 -0
- package/dist/utilities/useAnnounce.js.map +1 -0
- package/dist/utilities/useDateFieldLocale.d.ts +2 -0
- package/dist/utilities/useDateFieldLocale.d.ts.map +1 -0
- package/dist/utilities/useDateFieldLocale.js +11 -0
- package/dist/utilities/useDateFieldLocale.js.map +1 -0
- package/package.json +4 -4
- package/dist/packages/tapestry-wc/dist/components/p-6NO22Vi_.js.map +0 -1
- package/dist/packages/tapestry-wc/dist/components/p-B2xqMgNQ.js.map +0 -1
- package/dist/packages/tapestry-wc/dist/components/p-BVvtAaVT.js.map +0 -1
- package/dist/packages/tapestry-wc/dist/components/p-Rn6lOB18.js.map +0 -1
- package/dist/packages/tapestry-wc/dist/components/p-np7vhMVg.js.map +0 -1
|
@@ -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 isSameDay,\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 /** If `true`, always shows leading zeros in the year segment for years less than 1000. Defaults to true. */\n alwaysShowFourDigitYear?: boolean\n /** The initial value for uncontrolled usage. Accepts a DateValue or ISO date string. */\n defaultValue?: DatePickerDateValue | null\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 /**\n * Called on blur with the current complete value, if any, so it can be\n * normalized (e.g. correcting a 2-digit year to 4 digits). If the returned\n * value differs from the current one, the field updates to match.\n */\n formatDateOnBlur?: (date: DateValue) => DateValue\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 | \"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\nfunction useValue({\n defaultValue,\n onChange,\n value,\n}: Pick<DatePickerProps, \"defaultValue\" | \"onChange\" | \"value\">): [\n DateValue | null,\n (value: DateValue | null) => void,\n] {\n const [uncontrolledValue, setUncontrolledValue] = useState(\n () => toCalendarDate(defaultValue) ?? null\n )\n if (value !== undefined) {\n return [toCalendarDate(value) ?? null, (...args) => onChange?.(...args)]\n }\n return [\n uncontrolledValue,\n (value) => {\n onChange?.(value)\n setUncontrolledValue(value)\n },\n ]\n}\n\n// Expands 2-digit years to 4 digits using the POSIX windowing rule: last 80 years and next 19 years.\nfunction expandTwoDigitYearsViaPOSIX(date: DateValue): DateValue {\n if (date.year >= 100) return date\n\n const currentYear = todayCalendar(getLocalTimeZone()).year\n const currentCentury = Math.floor(currentYear / 100) * 100\n const windowStart = currentYear - 80\n\n let fullYear = currentCentury + date.year\n if (fullYear < windowStart) fullYear += 100\n else if (fullYear > windowStart + 99) fullYear -= 100\n\n return date.set({ year: fullYear })\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`, `defaultValue`, `min`, and `max` also accept ISO date strings\n * (`\"YYYY-MM-DD\"`) for convenience. Restrict the selectable range with\n * `min`/`max`, or mark individual dates as unavailable via `isDateUnavailable`.\n *\n * Renders uncontrolled when `value` is omitted: pass `defaultValue` to set\n * the initial date without managing state.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-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 defaultValue,\n description,\n disabled,\n firstDayOfWeek,\n formatDateOnBlur = expandTwoDigitYearsViaPOSIX,\n hideLabel,\n invalid,\n isDateUnavailable,\n label,\n max,\n min,\n onBlur,\n onChange,\n readOnly,\n required,\n size = \"md\",\n value,\n alwaysShowFourDigitYear = false,\n ...restProps\n}: DatePickerElementProps) {\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 const [computedValue, setComputedValue] = useValue({\n defaultValue,\n onChange,\n value,\n })\n\n return (\n <AriaDatePicker\n {...restProps}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n isDateUnavailable={isDateUnavailable}\n isDisabled={disabled}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={convertedMax}\n minValue={convertedMin}\n onBlur={(event) => {\n onBlur?.(event)\n if (!formatDateOnBlur || !computedValue) return\n\n const formattedValue = formatDateOnBlur(computedValue)\n if (isSameDay(formattedValue, computedValue)) return\n\n setComputedValue(formattedValue)\n }}\n onChange={(newValue) => {\n setComputedValue(newValue)\n }}\n onOpenChange={(isOpen) => {\n if (!isOpen) setActiveOverlay(null)\n }}\n value={computedValue}\n >\n {!hideLabel && <Label className=\"tds-field-label\">{label}</Label>}\n <Group\n aria-invalid={invalid || undefined}\n className=\"tds-field-control tds-date-picker-field\"\n >\n <DateInput className=\"tds-date-picker-input\">\n {(segment) => (\n <DateSegment\n aria-invalid={invalid || undefined}\n className={\n segment.type === \"literal\"\n ? \"tds-field-date-segment-separator\"\n : \"tds-field-date-segment\"\n }\n segment={\n segment.type === \"year\" &&\n !segment.isPlaceholder &&\n segment.value != null &&\n alwaysShowFourDigitYear\n ? {\n ...segment,\n text: new Intl.NumberFormat(undefined, {\n minimumIntegerDigits: 4,\n useGrouping: false,\n }).format(segment.value),\n }\n : segment\n }\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","CalendarDate","AriaDatePicker","isSameDay"],"mappings":";;;;;;;;;;;AAqCA,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;AAC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,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;;;;"}
|
|
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 isSameDay,\n parseDate,\n today as todayCalendar,\n} from \"@internationalized/date\"\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useDateFieldLocale } from \"@utilities/useDateFieldLocale\"\nimport classNames from \"classnames\"\nimport React, { type ReactNode, useContext, useState } from \"react\"\nimport { I18nProvider } from \"react-aria/I18nProvider\"\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 /** If `true`, always shows leading zeros in the year segment for years less than 1000. Defaults to true. */\n alwaysShowFourDigitYear?: boolean\n /** The initial value for uncontrolled usage. Accepts a DateValue or ISO date string. */\n defaultValue?: DatePickerDateValue | null\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 /**\n * Called on blur with the current complete value, if any, so it can be\n * normalized (e.g. correcting a 2-digit year to 4 digits). If the returned\n * value differs from the current one, the field updates to match.\n */\n formatDateOnBlur?: (date: DateValue) => DateValue\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 | \"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\nfunction useValue({\n defaultValue,\n onChange,\n value,\n}: Pick<DatePickerProps, \"defaultValue\" | \"onChange\" | \"value\">): [\n DateValue | null,\n (value: DateValue | null) => void,\n] {\n const [uncontrolledValue, setUncontrolledValue] = useState(\n () => toCalendarDate(defaultValue) ?? null\n )\n if (value !== undefined) {\n return [toCalendarDate(value) ?? null, (...args) => onChange?.(...args)]\n }\n return [\n uncontrolledValue,\n (value) => {\n onChange?.(value)\n setUncontrolledValue(value)\n },\n ]\n}\n\n// Expands 2-digit years to 4 digits using the POSIX windowing rule: last 80 years and next 19 years.\nfunction expandTwoDigitYearsViaPOSIX(date: DateValue): DateValue {\n if (date.year >= 100) return date\n\n const currentYear = todayCalendar(getLocalTimeZone()).year\n const currentCentury = Math.floor(currentYear / 100) * 100\n const windowStart = currentYear - 80\n\n let fullYear = currentCentury + date.year\n if (fullYear < windowStart) fullYear += 100\n else if (fullYear > windowStart + 99) fullYear -= 100\n\n return date.set({ year: fullYear })\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`, `defaultValue`, `min`, and `max` also accept ISO date strings\n * (`\"YYYY-MM-DD\"`) for convenience. Restrict the selectable range with\n * `min`/`max`, or mark individual dates as unavailable via `isDateUnavailable`.\n *\n * Renders uncontrolled when `value` is omitted: pass `defaultValue` to set\n * the initial date without managing state.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-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 defaultValue,\n description,\n disabled,\n firstDayOfWeek,\n formatDateOnBlur = expandTwoDigitYearsViaPOSIX,\n hideLabel,\n invalid,\n isDateUnavailable,\n label,\n max,\n min,\n onBlur,\n onChange,\n readOnly,\n required,\n size = \"md\",\n value,\n alwaysShowFourDigitYear = false,\n ...restProps\n}: DatePickerElementProps) {\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 const [computedValue, setComputedValue] = useValue({\n defaultValue,\n onChange,\n value,\n })\n\n const dateFieldLocale = useDateFieldLocale()\n\n return (\n <AriaDatePicker\n {...restProps}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n isDateUnavailable={isDateUnavailable}\n isDisabled={disabled}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={convertedMax}\n minValue={convertedMin}\n onBlur={(event) => {\n onBlur?.(event)\n if (!formatDateOnBlur || !computedValue) return\n\n const formattedValue = formatDateOnBlur(computedValue)\n if (isSameDay(formattedValue, computedValue)) return\n\n setComputedValue(formattedValue)\n }}\n onChange={(newValue) => {\n setComputedValue(newValue)\n }}\n onOpenChange={(isOpen) => {\n if (!isOpen) setActiveOverlay(null)\n }}\n value={computedValue}\n >\n {!hideLabel && <Label className=\"tds-field-label\">{label}</Label>}\n <Group\n aria-invalid={invalid || undefined}\n className=\"tds-field-control tds-date-picker-field\"\n >\n <I18nProvider locale={dateFieldLocale}>\n <DateInput className=\"tds-date-picker-input\">\n {(segment) => (\n <DateSegment\n aria-invalid={invalid || undefined}\n className={\n segment.type === \"literal\"\n ? \"tds-field-date-segment-separator\"\n : \"tds-field-date-segment\"\n }\n segment={\n segment.type === \"year\" &&\n !segment.isPlaceholder &&\n segment.value != null &&\n alwaysShowFourDigitYear\n ? {\n ...segment,\n text: new Intl.NumberFormat(undefined, {\n minimumIntegerDigits: 4,\n useGrouping: false,\n }).format(segment.value),\n }\n : segment\n }\n />\n )}\n </DateInput>\n </I18nProvider>\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","CalendarDate","AriaDatePicker","isSameDay"],"mappings":";;;;;;;;;;;;;AAuCA,MAAM,MAAM,GAAGA,yCAAa,CAACC,yCAAgB,EAAE,CAAC;AAChD,MAAM,MAA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AAS,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;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const LOADING_ANNOUNCEMENT_DELAY_MS = 500;
|
|
2
|
+
/**
|
|
3
|
+
* Announces `message` to screen reader users while a loading indicator is
|
|
4
|
+
* shown. Render it next to the spinner, only while loading. It waits
|
|
5
|
+
* {@link LOADING_ANNOUNCEMENT_DELAY_MS} after mount, so a fast load says
|
|
6
|
+
* nothing, and it cancels if it unmounts first.
|
|
7
|
+
*/
|
|
8
|
+
export declare function LoadingAnnouncement({ message }: {
|
|
9
|
+
message: string;
|
|
10
|
+
}): null;
|
|
11
|
+
//# sourceMappingURL=LoadingAnnouncement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/internal/LoadingAnnouncement.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,6BAA6B,MAAM,CAAA;AAEhD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,QAYnE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useAnnounce } from '../../utilities/useAnnounce.js';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
const LOADING_ANNOUNCEMENT_DELAY_MS = 500;
|
|
5
|
+
/**
|
|
6
|
+
* Announces `message` to screen reader users while a loading indicator is
|
|
7
|
+
* shown. Render it next to the spinner, only while loading. It waits
|
|
8
|
+
* {@link LOADING_ANNOUNCEMENT_DELAY_MS} after mount, so a fast load says
|
|
9
|
+
* nothing, and it cancels if it unmounts first.
|
|
10
|
+
*/
|
|
11
|
+
function LoadingAnnouncement({ message }) {
|
|
12
|
+
const announce = useAnnounce();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const timeout = setTimeout(() => announce(message), LOADING_ANNOUNCEMENT_DELAY_MS);
|
|
15
|
+
return () => clearTimeout(timeout);
|
|
16
|
+
}, [announce, message]);
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { LOADING_ANNOUNCEMENT_DELAY_MS, LoadingAnnouncement };
|
|
21
|
+
//# sourceMappingURL=LoadingAnnouncement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingAnnouncement.js","sources":["../../../src/components/internal/LoadingAnnouncement.tsx"],"sourcesContent":["import { useAnnounce } from \"@utilities/useAnnounce\"\nimport { useEffect } from \"react\"\n\nexport const LOADING_ANNOUNCEMENT_DELAY_MS = 500\n\n/**\n * Announces `message` to screen reader users while a loading indicator is\n * shown. Render it next to the spinner, only while loading. It waits\n * {@link LOADING_ANNOUNCEMENT_DELAY_MS} after mount, so a fast load says\n * nothing, and it cancels if it unmounts first.\n */\nexport function LoadingAnnouncement({ message }: { message: string }) {\n const announce = useAnnounce()\n\n useEffect(() => {\n const timeout = setTimeout(\n () => announce(message),\n LOADING_ANNOUNCEMENT_DELAY_MS\n )\n return () => clearTimeout(timeout)\n }, [announce, message])\n\n return null\n}\n"],"names":[],"mappings":";;;AAGO,MAAM,6BAA6B,GAAG;AAE7C;;;;;AAKG;AACG,SAAU,mBAAmB,CAAC,EAAE,OAAO,EAAuB,EAAA;AAClE,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE;IAE9B,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAG,UAAU,CACxB,MAAM,QAAQ,CAAC,OAAO,CAAC,EACvB,6BAA6B,CAC9B;AACD,QAAA,OAAO,MAAM,YAAY,CAAC,OAAO,CAAC;AACpC,IAAA,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAEvB,IAAA,OAAO,IAAI;AACb;;;;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import "../../modal/index.css";
|
|
2
|
+
import "./index.css";
|
|
3
|
+
import React, { type HTMLAttributes } from "react";
|
|
4
|
+
export type AlertDialogType = "danger" | "error" | "info" | "success" | "warning";
|
|
5
|
+
export interface AlertDialogProps {
|
|
6
|
+
/** Default `'Cancel'`. The cancel button's label. */
|
|
7
|
+
cancelButtonLabel?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The content explaining the alert. Becomes the alert's accessible
|
|
10
|
+
* description. A string is wrapped in a `<p>`.
|
|
11
|
+
*/
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/** Default `'Okay'`. The confirm button's label. */
|
|
14
|
+
confirmButtonLabel?: string;
|
|
15
|
+
/** Default `false`. `true` hides the cancel button, for simple notifications. */
|
|
16
|
+
hideCancel?: boolean;
|
|
17
|
+
/** Fires when the cancel button is clicked, or Esc is pressed. */
|
|
18
|
+
onCancel?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Fires when the confirm button is clicked, or Esc is pressed when
|
|
21
|
+
* `hideCancel` is set.
|
|
22
|
+
*/
|
|
23
|
+
onConfirm?: () => void;
|
|
24
|
+
/** Controls the alert. */
|
|
25
|
+
open: boolean;
|
|
26
|
+
/** The alert's accessible name, displayed as the heading. */
|
|
27
|
+
title: string;
|
|
28
|
+
/**
|
|
29
|
+
* Default `'warning'`. Sets the status icon and its color. `'danger'` also
|
|
30
|
+
* renders the confirm button as a `delete` button.
|
|
31
|
+
*/
|
|
32
|
+
type?: AlertDialogType;
|
|
33
|
+
}
|
|
34
|
+
export type AlertDialogElementProps = Omit<HTMLAttributes<HTMLElement>, keyof AlertDialogProps | "role"> & AlertDialogProps;
|
|
35
|
+
/**
|
|
36
|
+
* A modal dialog that interrupts the user with an important message and asks
|
|
37
|
+
* them to confirm or cancel. Renders with `role="alertdialog"` and shares
|
|
38
|
+
* `Modal`'s overlay, frame, and animation styles.
|
|
39
|
+
*
|
|
40
|
+
* Neither button closes the alert on its own — close it by setting `open` to
|
|
41
|
+
* `false` from `onConfirm` and `onCancel`.
|
|
42
|
+
*
|
|
43
|
+
* Esc fires `onCancel`, or `onConfirm` when `hideCancel` is set, so the alert
|
|
44
|
+
* is always dismissible from the keyboard. The exception is a `danger` alert
|
|
45
|
+
* with `hideCancel`, where Esc does nothing so it can't confirm a destructive
|
|
46
|
+
* action. Backdrop clicks never dismiss the alert.
|
|
47
|
+
*
|
|
48
|
+
* Rest props, including `data-*`, land on the dialog. The buttons carry
|
|
49
|
+
* `data-alert-dialog-action="cancel" | "confirm"`, so non-React environments
|
|
50
|
+
* (e.g. Rails + Stimulus) can handle their clicks from the dialog.
|
|
51
|
+
*
|
|
52
|
+
* @component
|
|
53
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/internal-alertdialog--docs | Storybook Documentation}
|
|
54
|
+
*/
|
|
55
|
+
export declare const AlertDialog: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "role" | keyof AlertDialogProps> & AlertDialogProps & React.RefAttributes<HTMLElement>>;
|
|
56
|
+
//# sourceMappingURL=AlertDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/alert-dialog/AlertDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAC9B,OAAO,aAAa,CAAA;AAMpB,OAAO,KAAK,EAAE,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAI9D,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR,OAAO,GACP,MAAM,GACN,SAAS,GACT,SAAS,CAAA;AAEb,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,iFAAiF;IACjF,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,0BAA0B;IAC1B,IAAI,EAAE,OAAO,CAAA;IACb,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAA;CACvB;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,cAAc,CAAC,WAAW,CAAC,EAC3B,MAAM,gBAAgB,GAAG,MAAM,CAChC,GACC,gBAAgB,CAAA;AAUlB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW,iKA+EvB,CAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import '../../button/ActionsDropdownIconButton.js';
|
|
2
|
+
import { Button } from '../../button/Button.js';
|
|
3
|
+
import '../../button/DropdownButton.js';
|
|
4
|
+
import '../../button/DropdownIconButton.js';
|
|
5
|
+
import '../../button/IconButton.js';
|
|
6
|
+
import '../../button/LoadingButton.js';
|
|
7
|
+
import '../../button/PageHeaderActionsDropdownButton.js';
|
|
8
|
+
import Icon from '../../../utilities/Icon.js';
|
|
9
|
+
import { useId } from '../../../utilities/useId.js';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import React__default, { forwardRef } from 'react';
|
|
12
|
+
import { Dialog } from 'react-aria-components/Dialog';
|
|
13
|
+
import { ModalOverlay, Modal } from 'react-aria-components/Modal';
|
|
14
|
+
|
|
15
|
+
const ICON_SYMBOLS = {
|
|
16
|
+
danger: "general#exclamation-triangle",
|
|
17
|
+
error: "general#x-circle",
|
|
18
|
+
info: "general#info-circle",
|
|
19
|
+
success: "general#check-circle",
|
|
20
|
+
warning: "general#exclamation-triangle",
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A modal dialog that interrupts the user with an important message and asks
|
|
24
|
+
* them to confirm or cancel. Renders with `role="alertdialog"` and shares
|
|
25
|
+
* `Modal`'s overlay, frame, and animation styles.
|
|
26
|
+
*
|
|
27
|
+
* Neither button closes the alert on its own — close it by setting `open` to
|
|
28
|
+
* `false` from `onConfirm` and `onCancel`.
|
|
29
|
+
*
|
|
30
|
+
* Esc fires `onCancel`, or `onConfirm` when `hideCancel` is set, so the alert
|
|
31
|
+
* is always dismissible from the keyboard. The exception is a `danger` alert
|
|
32
|
+
* with `hideCancel`, where Esc does nothing so it can't confirm a destructive
|
|
33
|
+
* action. Backdrop clicks never dismiss the alert.
|
|
34
|
+
*
|
|
35
|
+
* Rest props, including `data-*`, land on the dialog. The buttons carry
|
|
36
|
+
* `data-alert-dialog-action="cancel" | "confirm"`, so non-React environments
|
|
37
|
+
* (e.g. Rails + Stimulus) can handle their clicks from the dialog.
|
|
38
|
+
*
|
|
39
|
+
* @component
|
|
40
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/internal-alertdialog--docs | Storybook Documentation}
|
|
41
|
+
*/
|
|
42
|
+
const AlertDialog = forwardRef(function AlertDialog({ cancelButtonLabel = "Cancel", children, className, confirmButtonLabel = "Okay", hideCancel = false, id, onCancel, onConfirm, open, title, type = "warning", ...restProps }, ref) {
|
|
43
|
+
const stableId = useId();
|
|
44
|
+
const alertDialogId = id || `tds-alert-dialog-${stableId}`;
|
|
45
|
+
const titleId = `${alertDialogId}-title`;
|
|
46
|
+
const bodyId = `${alertDialogId}-body`;
|
|
47
|
+
return (React__default.createElement(ModalOverlay, { className: "tds-modal-overlay", isDismissable: false, isKeyboardDismissDisabled: hideCancel && type === "danger", isOpen: open, onOpenChange: (isOpen) => {
|
|
48
|
+
if (isOpen)
|
|
49
|
+
return;
|
|
50
|
+
if (hideCancel)
|
|
51
|
+
onConfirm?.();
|
|
52
|
+
else
|
|
53
|
+
onCancel?.();
|
|
54
|
+
} },
|
|
55
|
+
React__default.createElement(Modal, { className: "tds-modal-frame" },
|
|
56
|
+
React__default.createElement(Dialog, { ...restProps, ref: ref, "aria-describedby": bodyId, "aria-labelledby": titleId, className: classNames("tds-modal", "tds-alert-dialog", className), id: alertDialogId, role: "alertdialog" },
|
|
57
|
+
React__default.createElement("header", { className: "tds-alert-dialog-header" },
|
|
58
|
+
React__default.createElement(Icon, { "aria-hidden": true, className: `tds-alert-dialog-icon tds-alert-dialog-icon--${type}`, symbol: ICON_SYMBOLS[type] }),
|
|
59
|
+
React__default.createElement("h2", { className: "tds-alert-dialog-title", id: titleId }, title)),
|
|
60
|
+
React__default.createElement("div", { className: "tds-alert-dialog-body", id: bodyId }, typeof children === "string" ? React__default.createElement("p", null, children) : children),
|
|
61
|
+
React__default.createElement("footer", { className: "tds-modal-footer tds-alert-dialog-footer" },
|
|
62
|
+
!hideCancel && (React__default.createElement(Button, { "data-alert-dialog-action": "cancel", kind: "ghost", label: cancelButtonLabel, onClick: onCancel })),
|
|
63
|
+
React__default.createElement(Button, { "data-alert-dialog-action": "confirm", kind: type === "danger" ? "delete" : "primary", label: confirmButtonLabel, onClick: onConfirm }))))));
|
|
64
|
+
});
|
|
65
|
+
AlertDialog.displayName = "AlertDialog";
|
|
66
|
+
|
|
67
|
+
export { AlertDialog };
|
|
68
|
+
//# sourceMappingURL=AlertDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertDialog.js","sources":["../../../../src/components/internal/alert-dialog/AlertDialog.tsx"],"sourcesContent":["import \"../../modal/index.css\"\nimport \"./index.css\"\n\nimport { Button } from \"@components/button\"\nimport Icon from \"@utilities/Icon\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { forwardRef, type HTMLAttributes } from \"react\"\nimport { Dialog } from \"react-aria-components/Dialog\"\nimport { Modal as AriaModal, ModalOverlay } from \"react-aria-components/Modal\"\n\nexport type AlertDialogType =\n | \"danger\"\n | \"error\"\n | \"info\"\n | \"success\"\n | \"warning\"\n\nexport interface AlertDialogProps {\n /** Default `'Cancel'`. The cancel button's label. */\n cancelButtonLabel?: string\n /**\n * The content explaining the alert. Becomes the alert's accessible\n * description. A string is wrapped in a `<p>`.\n */\n children: React.ReactNode\n /** Default `'Okay'`. The confirm button's label. */\n confirmButtonLabel?: string\n /** Default `false`. `true` hides the cancel button, for simple notifications. */\n hideCancel?: boolean\n /** Fires when the cancel button is clicked, or Esc is pressed. */\n onCancel?: () => void\n /**\n * Fires when the confirm button is clicked, or Esc is pressed when\n * `hideCancel` is set.\n */\n onConfirm?: () => void\n /** Controls the alert. */\n open: boolean\n /** The alert's accessible name, displayed as the heading. */\n title: string\n /**\n * Default `'warning'`. Sets the status icon and its color. `'danger'` also\n * renders the confirm button as a `delete` button.\n */\n type?: AlertDialogType\n}\n\nexport type AlertDialogElementProps = Omit<\n HTMLAttributes<HTMLElement>,\n keyof AlertDialogProps | \"role\"\n> &\n AlertDialogProps\n\nconst ICON_SYMBOLS: Record<AlertDialogType, string> = {\n danger: \"general#exclamation-triangle\",\n error: \"general#x-circle\",\n info: \"general#info-circle\",\n success: \"general#check-circle\",\n warning: \"general#exclamation-triangle\",\n}\n\n/**\n * A modal dialog that interrupts the user with an important message and asks\n * them to confirm or cancel. Renders with `role=\"alertdialog\"` and shares\n * `Modal`'s overlay, frame, and animation styles.\n *\n * Neither button closes the alert on its own — close it by setting `open` to\n * `false` from `onConfirm` and `onCancel`.\n *\n * Esc fires `onCancel`, or `onConfirm` when `hideCancel` is set, so the alert\n * is always dismissible from the keyboard. The exception is a `danger` alert\n * with `hideCancel`, where Esc does nothing so it can't confirm a destructive\n * action. Backdrop clicks never dismiss the alert.\n *\n * Rest props, including `data-*`, land on the dialog. The buttons carry\n * `data-alert-dialog-action=\"cancel\" | \"confirm\"`, so non-React environments\n * (e.g. Rails + Stimulus) can handle their clicks from the dialog.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/internal-alertdialog--docs | Storybook Documentation}\n */\nexport const AlertDialog = forwardRef<HTMLElement, AlertDialogElementProps>(\n function AlertDialog(\n {\n cancelButtonLabel = \"Cancel\",\n children,\n className,\n confirmButtonLabel = \"Okay\",\n hideCancel = false,\n id,\n onCancel,\n onConfirm,\n open,\n title,\n type = \"warning\",\n ...restProps\n }: AlertDialogElementProps,\n ref\n ) {\n const stableId = useId()\n const alertDialogId = id || `tds-alert-dialog-${stableId}`\n const titleId = `${alertDialogId}-title`\n const bodyId = `${alertDialogId}-body`\n\n return (\n <ModalOverlay\n className=\"tds-modal-overlay\"\n isDismissable={false}\n isKeyboardDismissDisabled={hideCancel && type === \"danger\"}\n isOpen={open}\n onOpenChange={(isOpen) => {\n if (isOpen) return\n if (hideCancel) onConfirm?.()\n else onCancel?.()\n }}\n >\n <AriaModal className=\"tds-modal-frame\">\n <Dialog\n {...restProps}\n ref={ref}\n aria-describedby={bodyId}\n aria-labelledby={titleId}\n className={classNames(\"tds-modal\", \"tds-alert-dialog\", className)}\n id={alertDialogId}\n role=\"alertdialog\"\n >\n <header className=\"tds-alert-dialog-header\">\n <Icon\n aria-hidden\n className={`tds-alert-dialog-icon tds-alert-dialog-icon--${type}`}\n symbol={ICON_SYMBOLS[type]}\n />\n <h2 className=\"tds-alert-dialog-title\" id={titleId}>\n {title}\n </h2>\n </header>\n <div className=\"tds-alert-dialog-body\" id={bodyId}>\n {typeof children === \"string\" ? <p>{children}</p> : children}\n </div>\n <footer className=\"tds-modal-footer tds-alert-dialog-footer\">\n {!hideCancel && (\n <Button\n data-alert-dialog-action=\"cancel\"\n kind=\"ghost\"\n label={cancelButtonLabel}\n onClick={onCancel}\n />\n )}\n <Button\n data-alert-dialog-action=\"confirm\"\n kind={type === \"danger\" ? \"delete\" : \"primary\"}\n label={confirmButtonLabel}\n onClick={onConfirm}\n />\n </footer>\n </Dialog>\n </AriaModal>\n </ModalOverl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,GAAG,SAAS,EAC9C,KAAK,EAAE,kBAAkB,EACzB,OAAO,EAAE,SAAS,EAAA,CAClB,CACK,CACF,CACC,CACC;AAEnB,CAAC;AAGH,WAAW,CAAC,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/alert-dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAC9B,OAAO,aAAa,CAAA;AAEpB,YAAY,EACV,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,GAChB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAE7C,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React, { type ReactElement } from "react";
|
|
2
2
|
import { type Placement } from "react-aria/useOverlayPosition";
|
|
3
|
+
/** Where a tooltip renders relative to its trigger. */
|
|
4
|
+
export type TooltipPlacement = Placement;
|
|
3
5
|
export interface TooltipProps {
|
|
4
6
|
/**
|
|
5
|
-
* A single `BaseButton`-derived element (e.g. `IconButton`, `Button`) to
|
|
7
|
+
* A single `BaseButton`- or `BaseLink`-derived element (e.g. `IconButton`, `Button`, `IconLink`) to
|
|
6
8
|
* act as the trigger. Must be exactly one trigger — nothing enforces this
|
|
7
9
|
* at runtime, so a fragment with more than one child would silently hand
|
|
8
10
|
* every child the same ref and trigger props.
|
|
@@ -14,7 +16,13 @@ export interface TooltipProps {
|
|
|
14
16
|
*/
|
|
15
17
|
content: string;
|
|
16
18
|
/** Where the tooltip renders relative to the trigger. Default `'bottom start'`. */
|
|
17
|
-
placement?:
|
|
19
|
+
placement?: TooltipPlacement;
|
|
20
|
+
/**
|
|
21
|
+
* Shows the tooltip on screen only. The tooltip is hidden from assistive
|
|
22
|
+
* tech and not linked to the trigger, so the trigger must carry its own
|
|
23
|
+
* name (e.g. `aria-label`).
|
|
24
|
+
*/
|
|
25
|
+
visualOnly?: boolean;
|
|
18
26
|
}
|
|
19
27
|
/**
|
|
20
28
|
* Shows a short hover/focus hint next to a trigger. Built from React Aria's
|
|
@@ -22,10 +30,10 @@ export interface TooltipProps {
|
|
|
22
30
|
* that component unmounts its content entirely while closed, so a screen
|
|
23
31
|
* reader's virtual cursor never gets access to the description unless real
|
|
24
32
|
* DOM focus lands on the trigger. This keeps the tooltip content always
|
|
25
|
-
* mounted and wires `aria-describedby`
|
|
26
|
-
* visibility.
|
|
33
|
+
* mounted and wires `aria-describedby` (unless `visualOnly`), toggling only
|
|
34
|
+
* CSS visibility.
|
|
27
35
|
*/
|
|
28
|
-
export declare function Tooltip({ children, content, placement, }: TooltipProps): React.JSX.Element;
|
|
36
|
+
export declare function Tooltip({ children, content, placement, visualOnly, }: TooltipProps): React.JSX.Element;
|
|
29
37
|
export declare namespace Tooltip {
|
|
30
38
|
var displayName: string;
|
|
31
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,KAAK,YAAY,EAAU,MAAM,OAAO,CAAA;AAExD,OAAO,EACL,KAAK,SAAS,EAEf,MAAM,+BAA+B,CAAA;AActC,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,QAAQ,EAAE,YAAY,CAAA;IACtB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,mFAAmF;IACnF,SAAS,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,KAAK,YAAY,EAAU,MAAM,OAAO,CAAA;AAExD,OAAO,EACL,KAAK,SAAS,EAEf,MAAM,+BAA+B,CAAA;AActC,uDAAuD;AACvD,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAA;AAExC,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,QAAQ,EAAE,YAAY,CAAA;IACtB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,mFAAmF;IACnF,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,SAA0B,EAC1B,UAAkB,GACnB,EAAE,YAAY,qBA0Ed;yBA/Ee,OAAO"}
|
|
@@ -1,12 +1,67 @@
|
|
|
1
1
|
import { tokens } from '@planningcenter/tapestry-tokens/tokens';
|
|
2
|
-
import '
|
|
3
|
-
import 'classnames';
|
|
4
|
-
import 'react
|
|
5
|
-
import 'react-aria/
|
|
6
|
-
import 'react-aria/
|
|
7
|
-
import 'react-
|
|
8
|
-
import '
|
|
2
|
+
import { useId } from '../../../utilities/useId.js';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import React, { useRef } from 'react';
|
|
5
|
+
import { Overlay } from 'react-aria/Overlay';
|
|
6
|
+
import { useOverlayPosition } from 'react-aria/useOverlayPosition';
|
|
7
|
+
import { useTooltipTrigger, useTooltip } from 'react-aria/useTooltipTrigger';
|
|
8
|
+
import { useTooltipTriggerState } from 'react-stately/useTooltipTriggerState';
|
|
9
|
+
import { TooltipTriggerContext } from './TooltipTriggerContext.js';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
// Single source of truth for the arrow's dimensions -- index.css reads these
|
|
12
|
+
// via --tds-tooltip-arrow-size/--tds-tooltip-arrow-depth instead of its own literals.
|
|
13
|
+
const ARROW_SIZE = 10;
|
|
14
|
+
const ARROW_DEPTH = 5;
|
|
15
|
+
const FOCUS_RING_REACH = parseFloat(tokens["--t-focus-ring-offset"]) +
|
|
11
16
|
parseFloat(tokens["--t-focus-ring-width"]);
|
|
17
|
+
/**
|
|
18
|
+
* Shows a short hover/focus hint next to a trigger. Built from React Aria's
|
|
19
|
+
* tooltip hooks rather than `react-aria-components`'s `<Tooltip>`, because
|
|
20
|
+
* that component unmounts its content entirely while closed, so a screen
|
|
21
|
+
* reader's virtual cursor never gets access to the description unless real
|
|
22
|
+
* DOM focus lands on the trigger. This keeps the tooltip content always
|
|
23
|
+
* mounted and wires `aria-describedby` (unless `visualOnly`), toggling only
|
|
24
|
+
* CSS visibility.
|
|
25
|
+
*/
|
|
26
|
+
function Tooltip({ children, content, placement = "bottom start", visualOnly = false, }) {
|
|
27
|
+
const triggerRef = useRef(null);
|
|
28
|
+
const overlayRef = useRef(null);
|
|
29
|
+
const tooltipId = `tds-tooltip-${useId()}`;
|
|
30
|
+
const state = useTooltipTriggerState();
|
|
31
|
+
const { triggerProps } = useTooltipTrigger({}, state, triggerRef);
|
|
32
|
+
const { tooltipProps: ariaTooltipProps } = useTooltip({ id: tooltipId }, state);
|
|
33
|
+
const { arrowProps, overlayProps, placement: resolvedPlacement, } = useOverlayPosition({
|
|
34
|
+
arrowSize: ARROW_SIZE,
|
|
35
|
+
isOpen: state.isOpen,
|
|
36
|
+
offset: ARROW_DEPTH + FOCUS_RING_REACH,
|
|
37
|
+
onClose: () => state.close(true),
|
|
38
|
+
overlayRef,
|
|
39
|
+
placement,
|
|
40
|
+
targetRef: triggerRef,
|
|
41
|
+
});
|
|
42
|
+
const contextValue = {
|
|
43
|
+
ref: triggerRef,
|
|
44
|
+
triggerProps: {
|
|
45
|
+
...triggerProps,
|
|
46
|
+
"aria-describedby": visualOnly ? undefined : tooltipId,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
return (React.createElement(React.Fragment, null,
|
|
50
|
+
React.createElement(TooltipTriggerContext.Provider, { value: contextValue }, children),
|
|
51
|
+
React.createElement(Overlay, { disableFocusManagement: true },
|
|
52
|
+
React.createElement("div", { ...ariaTooltipProps, ...overlayProps, ref: overlayRef, "aria-hidden": visualOnly || undefined, className: classNames("tds-tooltip", {
|
|
53
|
+
"tds-tooltip--open": state.isOpen,
|
|
54
|
+
}), "data-placement": resolvedPlacement, style: {
|
|
55
|
+
...overlayProps.style,
|
|
56
|
+
"--tds-tooltip-arrow-depth-raw": `${ARROW_DEPTH}px`,
|
|
57
|
+
"--tds-tooltip-arrow-size-raw": `${ARROW_SIZE}px`,
|
|
58
|
+
} },
|
|
59
|
+
content,
|
|
60
|
+
React.createElement("div", { className: "tds-tooltip-arrow", ...arrowProps },
|
|
61
|
+
React.createElement("svg", { "aria-hidden": true, className: "tds-tooltip-arrow-icon", role: "img", viewBox: `0 0 ${ARROW_SIZE} ${ARROW_DEPTH}` },
|
|
62
|
+
React.createElement("polygon", { points: `${ARROW_SIZE / 2},0 0,${ARROW_DEPTH} ${ARROW_SIZE},${ARROW_DEPTH}` })))))));
|
|
63
|
+
}
|
|
64
|
+
Tooltip.displayName = "Tooltip";
|
|
65
|
+
|
|
66
|
+
export { Tooltip };
|
|
12
67
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../../src/components/internal/tooltip/Tooltip.tsx"],"sourcesContent":["import { tokens } from \"@planningcenter/tapestry-tokens/tokens\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { type ReactElement, useRef } from \"react\"\nimport { Overlay } from \"react-aria/Overlay\"\nimport {\n type Placement,\n useOverlayPosition,\n} from \"react-aria/useOverlayPosition\"\nimport { useTooltip, useTooltipTrigger } from \"react-aria/useTooltipTrigger\"\nimport { useTooltipTriggerState } from \"react-stately/useTooltipTriggerState\"\n\nimport { TooltipTriggerContext } from \"./TooltipTriggerContext\"\n\n// Single source of truth for the arrow's dimensions -- index.css reads these\n// via --tds-tooltip-arrow-size/--tds-tooltip-arrow-depth instead of its own literals.\nconst ARROW_SIZE = 10\nconst ARROW_DEPTH = 5\nconst FOCUS_RING_REACH =\n parseFloat(tokens[\"--t-focus-ring-offset\"]) +\n parseFloat(tokens[\"--t-focus-ring-width\"])\n\nexport interface TooltipProps {\n /**\n * A single `BaseButton`-derived element (e.g. `IconButton`, `Button`) to\n * act as the trigger. Must be exactly one trigger — nothing enforces this\n * at runtime, so a fragment with more than one child would silently hand\n * every child the same ref and trigger props.\n */\n children: ReactElement\n /**\n * The hint text. Best used with information beyond the trigger's accessible name\n * (e.g. its `aria-label` or visible label).\n */\n content: string\n /** Where the tooltip renders relative to the trigger. Default `'bottom start'`. */\n placement?:
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../../src/components/internal/tooltip/Tooltip.tsx"],"sourcesContent":["import { tokens } from \"@planningcenter/tapestry-tokens/tokens\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { type ReactElement, useRef } from \"react\"\nimport { Overlay } from \"react-aria/Overlay\"\nimport {\n type Placement,\n useOverlayPosition,\n} from \"react-aria/useOverlayPosition\"\nimport { useTooltip, useTooltipTrigger } from \"react-aria/useTooltipTrigger\"\nimport { useTooltipTriggerState } from \"react-stately/useTooltipTriggerState\"\n\nimport { TooltipTriggerContext } from \"./TooltipTriggerContext\"\n\n// Single source of truth for the arrow's dimensions -- index.css reads these\n// via --tds-tooltip-arrow-size/--tds-tooltip-arrow-depth instead of its own literals.\nconst ARROW_SIZE = 10\nconst ARROW_DEPTH = 5\nconst FOCUS_RING_REACH =\n parseFloat(tokens[\"--t-focus-ring-offset\"]) +\n parseFloat(tokens[\"--t-focus-ring-width\"])\n\n/** Where a tooltip renders relative to its trigger. */\nexport type TooltipPlacement = Placement\n\nexport interface TooltipProps {\n /**\n * A single `BaseButton`- or `BaseLink`-derived element (e.g. `IconButton`, `Button`, `IconLink`) to\n * act as the trigger. Must be exactly one trigger — nothing enforces this\n * at runtime, so a fragment with more than one child would silently hand\n * every child the same ref and trigger props.\n */\n children: ReactElement\n /**\n * The hint text. Best used with information beyond the trigger's accessible name\n * (e.g. its `aria-label` or visible label).\n */\n content: string\n /** Where the tooltip renders relative to the trigger. Default `'bottom start'`. */\n placement?: TooltipPlacement\n /**\n * Shows the tooltip on screen only. The tooltip is hidden from assistive\n * tech and not linked to the trigger, so the trigger must carry its own\n * name (e.g. `aria-label`).\n */\n visualOnly?: boolean\n}\n\n/**\n * Shows a short hover/focus hint next to a trigger. Built from React Aria's\n * tooltip hooks rather than `react-aria-components`'s `<Tooltip>`, because\n * that component unmounts its content entirely while closed, so a screen\n * reader's virtual cursor never gets access to the description unless real\n * DOM focus lands on the trigger. This keeps the tooltip content always\n * mounted and wires `aria-describedby` (unless `visualOnly`), toggling only\n * CSS visibility.\n */\nexport function Tooltip({\n children,\n content,\n placement = \"bottom start\",\n visualOnly = false,\n}: TooltipProps) {\n const triggerRef = useRef<HTMLElement>(null)\n const overlayRef = useRef<HTMLDivElement>(null)\n const tooltipId = `tds-tooltip-${useId()}`\n\n const state = useTooltipTriggerState()\n const { triggerProps } = useTooltipTrigger({}, state, triggerRef)\n const { tooltipProps: ariaTooltipProps } = useTooltip(\n { id: tooltipId },\n state\n )\n\n const {\n arrowProps,\n overlayProps,\n placement: resolvedPlacement,\n } = useOverlayPosition({\n arrowSize: ARROW_SIZE,\n isOpen: state.isOpen,\n offset: ARROW_DEPTH + FOCUS_RING_REACH,\n onClose: () => state.close(true),\n overlayRef,\n placement,\n targetRef: triggerRef,\n })\n\n const contextValue = {\n ref: triggerRef,\n triggerProps: {\n ...triggerProps,\n \"aria-describedby\": visualOnly ? undefined : tooltipId,\n },\n }\n\n return (\n <>\n <TooltipTriggerContext.Provider value={contextValue}>\n {children}\n </TooltipTriggerContext.Provider>\n <Overlay disableFocusManagement>\n <div\n {...ariaTooltipProps}\n {...overlayProps}\n ref={overlayRef}\n aria-hidden={visualOnly || undefined}\n className={classNames(\"tds-tooltip\", {\n \"tds-tooltip--open\": state.isOpen,\n })}\n data-placement={resolvedPlacement}\n style={\n {\n ...overlayProps.style,\n \"--tds-tooltip-arrow-depth-raw\": `${ARROW_DEPTH}px`,\n \"--tds-tooltip-arrow-size-raw\": `${ARROW_SIZE}px`,\n } as React.CSSProperties\n }\n >\n {content}\n <div className=\"tds-tooltip-arrow\" {...arrowProps}>\n <svg\n aria-hidden\n className=\"tds-tooltip-arrow-icon\"\n role=\"img\"\n viewBox={`0 0 ${ARROW_SIZE} ${ARROW_DEPTH}`}\n >\n <polygon\n points={`${ARROW_SIZE / 2},0 0,${ARROW_DEPTH} ${ARROW_SIZE},${ARROW_DEPTH}`}\n />\n </svg>\n </div>\n </div>\n </Overlay>\n </>\n )\n}\n\nTooltip.displayName = \"Tooltip\"\n"],"names":[],"mappings":";;;;;;;;;;AAcA;AACA;AACA,MAAM,UAAU,GAAG,EAAE;AACrB,MAAM,WAAW,GAAG,CAAC;AACrB,MAAM,gBAAgB,GACpB,UAAU,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAC3C,IAAA,UAAU,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;AA4B5C;;;;;;;;AAQG;AACG,SAAU,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO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AC7B,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GACM,gBAAgB,EAAA,GAChB,YAAY,EAChB,GAAG,EAAE,UAAU,EAAA,aAAA,EACF,UAAU,IAAI,SAAS,EACpC,SAAS,EAAE,UAAU,CAAC,aAAa,EAAE;oBACnC,mBAAmB,EAAE,KAAK,CAAC,MAAM;AAClC,iBAAA,CAAC,EAAA,gBAAA,EACc,iBAAiB,EACjC,KAAK,EACH;oBACE,GAAG,YAAY,CAAC,KAAK;oBACrB,+BAA+B,EAAE,CAAA,EAAG,WAAW,CAAA,EAAA,CAAI;oBACnD,8BAA8B,EAAE,CAAA,EAAG,UAAU,CAAA,EAAA,CAAI;AAC3B,iBAAA,EAAA;gBAGzB,OAAO;AACR,gBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,mBAAmB,EAAA,GAAK,UAAU,EAAA;AAC/C,oBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAEE,SAAS,EAAC,wBAAwB,EAClC,IAAI,EAAC,KAAK,EACV,OAAO,EAAE,CAAA,IAAA,EAAO,UAAU,CAAA,CAAA,EAAI,WAAW,CAAA,CAAE,EAAA;wBAE3C,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EACE,MAAM,EAAE,CAAA,EAAG,UAAU,GAAG,CAAC,CAAA,KAAA,EAAQ,WAAW,CAAA,CAAA,EAAI,UAAU,IAAI,WAAW,CAAA,CAAE,GAC3E,CACE,CACF,CACF,CACE,CACT;AAEP;AAEA,OAAO,CAAC,WAAW,GAAG,SAAS;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes, type RefObject } from "react";
|
|
2
|
-
/** Carries `<Tooltip>`'s trigger wiring down to the rendered
|
|
2
|
+
/** Carries `<Tooltip>`'s trigger wiring down to the rendered element, via `BaseButton` or `BaseLink`. */
|
|
3
3
|
export declare const TooltipTriggerContext: import("react").Context<{
|
|
4
|
-
ref: RefObject<
|
|
5
|
-
triggerProps: HTMLAttributes<
|
|
4
|
+
ref: RefObject<HTMLElement>;
|
|
5
|
+
triggerProps: HTMLAttributes<HTMLElement>;
|
|
6
6
|
} | null>;
|
|
7
7
|
//# sourceMappingURL=TooltipTriggerContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipTriggerContext.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/tooltip/TooltipTriggerContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE1E,
|
|
1
|
+
{"version":3,"file":"TooltipTriggerContext.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/tooltip/TooltipTriggerContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE1E,yGAAyG;AACzG,eAAO,MAAM,qBAAqB;SAC3B,SAAS,CAAC,WAAW,CAAC;kBACb,cAAc,CAAC,WAAW,CAAC;SAC5B,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
2
|
|
|
3
|
-
/** Carries `<Tooltip>`'s trigger wiring down to the rendered
|
|
3
|
+
/** Carries `<Tooltip>`'s trigger wiring down to the rendered element, via `BaseButton` or `BaseLink`. */
|
|
4
4
|
const TooltipTriggerContext = createContext(null);
|
|
5
5
|
|
|
6
6
|
export { TooltipTriggerContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipTriggerContext.js","sources":["../../../../src/components/internal/tooltip/TooltipTriggerContext.ts"],"sourcesContent":["import { createContext, type HTMLAttributes, type RefObject } from \"react\"\n\n/** Carries `<Tooltip>`'s trigger wiring down to the rendered
|
|
1
|
+
{"version":3,"file":"TooltipTriggerContext.js","sources":["../../../../src/components/internal/tooltip/TooltipTriggerContext.ts"],"sourcesContent":["import { createContext, type HTMLAttributes, type RefObject } from \"react\"\n\n/** Carries `<Tooltip>`'s trigger wiring down to the rendered element, via `BaseButton` or `BaseLink`. */\nexport const TooltipTriggerContext = createContext<{\n ref: RefObject<HTMLElement>\n triggerProps: HTMLAttributes<HTMLElement>\n} | null>(null)\n"],"names":[],"mappings":";;AAEA;MACa,qBAAqB,GAAG,aAAa,CAGxC,IAAI;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLink.d.ts","sourceRoot":"","sources":["../../../src/components/link/BaseLink.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"BaseLink.d.ts","sourceRoot":"","sources":["../../../src/components/link/BaseLink.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAI1B,OAAO,EACL,kBAAkB,EAGlB,aAAa,EAEd,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,KAAK,EAAE,EACZ,oBAAoB,EAIrB,MAAM,OAAO,CAAA;AAId,KAAK,iBAAiB,GAAG,kBAAkB,GACzC,IAAI,CACF,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,MAAM,kBAAkB,GAAG,UAAU,GAAG,MAAM,CAC/C,GAAG;IACF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACxB,CAAA;AAEH,MAAM,MAAM,oBAAoB,GAC5B,QAAQ,CACN,iBAAiB,GAAG;IAClB;;;;;OAKG;IACH,OAAO,EAAE,IAAI,CAAA;IACb,IAAI,CAAC,EAAE,KAAK,CAAA;CACb,CACF,GACD,QAAQ,CAAC,iBAAiB,GAAG;IAAE,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAEnE,eAAO,MAAM,QAAQ,gGAiEpB,CAAA"}
|