@planningcenter/tapestry 4.14.0 → 4.15.0-rc.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/ActiveFilters.d.ts +6 -1
- package/dist/components/DataTable/ActiveFilters.d.ts.map +1 -1
- package/dist/components/DataTable/ActiveFilters.js +18 -10
- package/dist/components/DataTable/ActiveFilters.js.map +1 -1
- package/dist/components/DataTable/CollectionEditorsStatic.js +2 -2
- package/dist/components/DataTable/CollectionEditorsStatic.js.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +8 -5
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +26 -14
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/DataTable/DataTableColumn.d.ts +12 -3
- package/dist/components/DataTable/DataTableColumn.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableColumnTypes.js +4 -4
- package/dist/components/DataTable/DataTableColumnTypes.js.map +1 -1
- package/dist/components/DataTable/ResultsCount.d.ts +2 -2
- package/dist/components/DataTable/ResultsCount.d.ts.map +1 -1
- package/dist/components/DataTable/ResultsCount.js +8 -7
- package/dist/components/DataTable/ResultsCount.js.map +1 -1
- package/dist/components/DataTable/SelectAllBanner.d.ts.map +1 -1
- package/dist/components/DataTable/SelectAllBanner.js +5 -3
- package/dist/components/DataTable/SelectAllBanner.js.map +1 -1
- package/dist/components/DataTable/TableActions.d.ts.map +1 -1
- package/dist/components/DataTable/TableActions.js +5 -3
- package/dist/components/DataTable/TableActions.js.map +1 -1
- package/dist/components/DataTable/dateFilter.js +28 -10
- package/dist/components/DataTable/dateFilter.js.map +1 -1
- package/dist/components/DataTable/dayFilter.js +4 -3
- package/dist/components/DataTable/dayFilter.js.map +1 -1
- package/dist/components/DataTable/numberFilter.js +2 -2
- package/dist/components/DataTable/numberFilter.js.map +1 -1
- package/dist/components/DataTable/useIsNarrowViewport.d.ts.map +1 -1
- package/dist/components/DataTable/useIsNarrowViewport.js +3 -1
- package/dist/components/DataTable/useIsNarrowViewport.js.map +1 -1
- package/dist/components/DataTable/useResultsAnnouncement.d.ts.map +1 -1
- package/dist/components/DataTable/useResultsAnnouncement.js +3 -1
- package/dist/components/DataTable/useResultsAnnouncement.js.map +1 -1
- package/dist/components/DataTable/useSavedViewsClient.d.ts +9 -2
- package/dist/components/DataTable/useSavedViewsClient.d.ts.map +1 -1
- package/dist/components/DataTable/useSavedViewsClient.js +9 -2
- package/dist/components/DataTable/useSavedViewsClient.js.map +1 -1
- package/dist/components/DataTable/useShelfExpanded.d.ts +4 -3
- package/dist/components/DataTable/useShelfExpanded.d.ts.map +1 -1
- package/dist/components/DataTable/useShelfExpanded.js +21 -5
- package/dist/components/DataTable/useShelfExpanded.js.map +1 -1
- package/dist/components/DataTable/views.js +1 -4
- package/dist/components/DataTable/views.js.map +1 -1
- package/dist/components/button/ActionsDropdownIconButton.js +1 -1
- package/dist/components/button/ActionsDropdownIconButton.js.map +1 -1
- package/dist/components/button/IconButton.js +1 -1
- package/dist/components/button/IconButton.js.map +1 -1
- package/dist/components/combo-box/ComboBox.d.ts.map +1 -1
- package/dist/components/combo-box/ComboBox.js +17 -2
- package/dist/components/combo-box/ComboBox.js.map +1 -1
- package/dist/components/currency-input/CurrencyInput.d.ts +1 -1
- package/dist/components/currency-input/CurrencyInput.d.ts.map +1 -1
- package/dist/components/currency-input/CurrencyInput.js +4 -1
- package/dist/components/currency-input/CurrencyInput.js.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +1 -1
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +72 -69
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/link/IconLink.js +1 -1
- package/dist/components/link/IconLink.js.map +1 -1
- package/dist/components/segmented-control/IconSegment.js +1 -1
- package/dist/components/segmented-control/IconSegment.js.map +1 -1
- package/dist/components/time-field/TimeField.d.ts.map +1 -1
- package/dist/components/time-field/TimeField.js +12 -9
- package/dist/components/time-field/TimeField.js.map +1 -1
- package/dist/reactRender.css +384 -379
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +384 -379
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/tapestryMount.css +384 -379
- package/dist/tapestryMount.css.map +1 -1
- package/dist/tapestryMountLegacy.css +384 -379
- package/dist/tapestryMountLegacy.css.map +1 -1
- package/dist/unstable.css +5 -0
- package/dist/unstable.css.map +1 -1
- package/dist/utilities/locale.d.ts +4 -4
- package/dist/utilities/locale.js +5 -34
- package/dist/utilities/locale.js.map +1 -1
- package/dist/utilities/useDateFieldLocale.js +2 -2
- package/dist/utilities/useDateFieldLocale.js.map +1 -1
- package/docs/components/DataTable.md +158 -0
- package/docs/llms.txt +3 -0
- package/package.json +5 -3
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { FilterOpenRequest } from "./FilterOpenRequest";
|
|
2
2
|
/**
|
|
3
3
|
* Expands the filters shelf when the filter count leaves zero, a pending
|
|
4
|
-
* filter is added,
|
|
5
|
-
*
|
|
4
|
+
* filter is added, a chip is asked to reopen, or the selected view becomes
|
|
5
|
+
* modified, and collapses it once it has no filters and the view isn't
|
|
6
|
+
* modified. Returns a toggle to control it.
|
|
6
7
|
*/
|
|
7
|
-
export declare function useShelfExpanded(filterCount: number, pendingCount: number, filterOpenRequest: FilterOpenRequest | null): [boolean, () => void];
|
|
8
|
+
export declare function useShelfExpanded(filterCount: number, pendingCount: number, filterOpenRequest: FilterOpenRequest | null, isViewModified: boolean): [boolean, () => void];
|
|
8
9
|
//# sourceMappingURL=useShelfExpanded.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShelfExpanded.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/useShelfExpanded.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D
|
|
1
|
+
{"version":3,"file":"useShelfExpanded.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/useShelfExpanded.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,EAC3C,cAAc,EAAE,OAAO,GACtB,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CA2DvB"}
|
|
@@ -2,18 +2,22 @@ import { useState, useCallback } from 'react';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Expands the filters shelf when the filter count leaves zero, a pending
|
|
5
|
-
* filter is added,
|
|
6
|
-
*
|
|
5
|
+
* filter is added, a chip is asked to reopen, or the selected view becomes
|
|
6
|
+
* modified, and collapses it once it has no filters and the view isn't
|
|
7
|
+
* modified. Returns a toggle to control it.
|
|
7
8
|
*/
|
|
8
|
-
function useShelfExpanded(filterCount, pendingCount, filterOpenRequest) {
|
|
9
|
-
const [isShelfExpanded, setIsShelfExpanded] = useState(() => filterCount > 0);
|
|
9
|
+
function useShelfExpanded(filterCount, pendingCount, filterOpenRequest, isViewModified) {
|
|
10
|
+
const [isShelfExpanded, setIsShelfExpanded] = useState(() => filterCount > 0 || isViewModified);
|
|
10
11
|
const [previousCount, setPreviousCount] = useState(filterCount);
|
|
11
12
|
const [previousPendingCount, setPreviousPendingCount] = useState(pendingCount);
|
|
12
13
|
const [previousOpenRequest, setPreviousOpenRequest] = useState(filterOpenRequest);
|
|
14
|
+
const [previousIsViewModified, setPreviousIsViewModified] = useState(isViewModified);
|
|
13
15
|
if (filterCount !== previousCount) {
|
|
14
16
|
setPreviousCount(filterCount);
|
|
17
|
+
// A modified view's actions stay in the shelf, and its toggle goes with
|
|
18
|
+
// the last filter, so it stays open to keep them reachable.
|
|
15
19
|
if (filterCount === 0) {
|
|
16
|
-
setIsShelfExpanded(
|
|
20
|
+
setIsShelfExpanded(isViewModified);
|
|
17
21
|
}
|
|
18
22
|
else if (previousCount === 0) {
|
|
19
23
|
setIsShelfExpanded(true);
|
|
@@ -33,6 +37,18 @@ function useShelfExpanded(filterCount, pendingCount, filterOpenRequest) {
|
|
|
33
37
|
setIsShelfExpanded(true);
|
|
34
38
|
}
|
|
35
39
|
}
|
|
40
|
+
// The shelf holds a modified view's actions, and a column or sort change
|
|
41
|
+
// modifies a view without touching the filters, so a shelf the user
|
|
42
|
+
// collapsed opens to show them.
|
|
43
|
+
if (isViewModified !== previousIsViewModified) {
|
|
44
|
+
setPreviousIsViewModified(isViewModified);
|
|
45
|
+
if (isViewModified) {
|
|
46
|
+
setIsShelfExpanded(true);
|
|
47
|
+
}
|
|
48
|
+
else if (filterCount === 0) {
|
|
49
|
+
setIsShelfExpanded(false);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
36
52
|
const toggleShelf = useCallback(() => {
|
|
37
53
|
setIsShelfExpanded((expanded) => !expanded);
|
|
38
54
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShelfExpanded.js","sources":["../../../src/components/DataTable/useShelfExpanded.ts"],"sourcesContent":["import { useCallback, useState } from \"react\"\n\nimport type { FilterOpenRequest } from \"./FilterOpenRequest\"\n\n/**\n * Expands the filters shelf when the filter count leaves zero, a pending\n * filter is added,
|
|
1
|
+
{"version":3,"file":"useShelfExpanded.js","sources":["../../../src/components/DataTable/useShelfExpanded.ts"],"sourcesContent":["import { useCallback, useState } from \"react\"\n\nimport type { FilterOpenRequest } from \"./FilterOpenRequest\"\n\n/**\n * Expands the filters shelf when the filter count leaves zero, a pending\n * filter is added, a chip is asked to reopen, or the selected view becomes\n * modified, and collapses it once it has no filters and the view isn't\n * modified. Returns a toggle to control it.\n */\nexport function useShelfExpanded(\n filterCount: number,\n pendingCount: number,\n filterOpenRequest: FilterOpenRequest | null,\n isViewModified: boolean\n): [boolean, () => void] {\n const [isShelfExpanded, setIsShelfExpanded] = useState(\n () => filterCount > 0 || isViewModified\n )\n const [previousCount, setPreviousCount] = useState(filterCount)\n const [previousPendingCount, setPreviousPendingCount] = useState(pendingCount)\n const [previousOpenRequest, setPreviousOpenRequest] =\n useState(filterOpenRequest)\n const [previousIsViewModified, setPreviousIsViewModified] =\n useState(isViewModified)\n\n if (filterCount !== previousCount) {\n setPreviousCount(filterCount)\n\n // A modified view's actions stay in the shelf, and its toggle goes with\n // the last filter, so it stays open to keep them reachable.\n if (filterCount === 0) {\n setIsShelfExpanded(isViewModified)\n } else if (previousCount === 0) {\n setIsShelfExpanded(true)\n }\n }\n\n if (pendingCount !== previousPendingCount) {\n setPreviousPendingCount(pendingCount)\n\n if (pendingCount > previousPendingCount) {\n setIsShelfExpanded(true)\n }\n }\n\n // A reopened chip holds focus and anchors its popover, so a shelf the user\n // collapsed has to come back before the chip can do either.\n if (filterOpenRequest !== previousOpenRequest) {\n setPreviousOpenRequest(filterOpenRequest)\n\n if (filterOpenRequest !== null) {\n setIsShelfExpanded(true)\n }\n }\n\n // The shelf holds a modified view's actions, and a column or sort change\n // modifies a view without touching the filters, so a shelf the user\n // collapsed opens to show them.\n if (isViewModified !== previousIsViewModified) {\n setPreviousIsViewModified(isViewModified)\n\n if (isViewModified) {\n setIsShelfExpanded(true)\n } else if (filterCount === 0) {\n setIsShelfExpanded(false)\n }\n }\n\n const toggleShelf = useCallback(() => {\n setIsShelfExpanded((expanded) => !expanded)\n }, [])\n\n return [isShelfExpanded, toggleShelf]\n}\n"],"names":[],"mappings":";;AAIA;;;;;AAKG;AACG,SAAU,gBAAgB,CAC9B,WAAmB,EACnB,YAAoB,EACpB,iBAA2C,EAC3C,cAAuB,EAAA;AAEvB,IAAA,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CACpD,MAAM,WAAW,GAAG,CAAC,IAAI,cAAc,CACxC;IACD,MAAM,CAAC,aAAa,EAAE,gBAAgB,C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E,CAAC;AAEN,IAAA,OAAO,CAAC,eAAe,EAAE,WAAW,CAAC;AACvC;;;;"}
|
|
@@ -43,7 +43,7 @@ function isViewEditable(view, savedViews) {
|
|
|
43
43
|
* against the table's columns first to ignore ones that are gone.
|
|
44
44
|
*/
|
|
45
45
|
function isViewModified(view, { activeFilters, sort, visibleColumnNames }) {
|
|
46
|
-
if (view.sort && sort &&
|
|
46
|
+
if (view.sort && sort && view.sort !== sort)
|
|
47
47
|
return true;
|
|
48
48
|
if (view.visibleColumnNames &&
|
|
49
49
|
visibleColumnNames &&
|
|
@@ -73,9 +73,6 @@ function isSameValue(a, b) {
|
|
|
73
73
|
return a === b;
|
|
74
74
|
return a.length === b.length && a.every((item, index) => item === b[index]);
|
|
75
75
|
}
|
|
76
|
-
function isSameSort(a, b) {
|
|
77
|
-
return a.column === b.column && a.direction === b.direction;
|
|
78
|
-
}
|
|
79
76
|
function isSameNames(a, b) {
|
|
80
77
|
return a.length === b.length && a.every((name) => b.includes(name));
|
|
81
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views.js","sources":["../../../src/components/DataTable/views.ts"],"sourcesContent":["import type { Sort } from \"./DataTable\"\nimport type { ActiveFilter } from \"./FilterTypes\"\nimport { isSearchFilter } from \"./useSearchFilter\"\n\n/** A static or saved view. */\nexport interface View {\n /** A search (`q`) filter is ignored; applying a view keeps the search. */\n activeFilters: ActiveFilter[]\n /**\n * Required on a static view. A saved view gets one from the consumer once\n * it's saved.\n */\n id?: number | string\n name: string\n /** Omit to leave the current sort unchanged when applied. */\n sort?: Sort\n /**\n * The columns the view shows. A hideable column it doesn't name is hidden,\n * so a column added later stays out of the view until it's saved with it.\n * Omit to leave the current column visibility unchanged when applied.\n */\n visibleColumnNames?: string[]\n}\n\n/** A user-created view, stored by the consumer. */\nexport type SavedView = View\n\n/** An app-provided view. Read-only. */\nexport type StaticView = View & { id: number | string }\n\n/**\n * Always listed, so there's a view to fall back to. Added before the static\n * views unless one of them uses its id, which replaces it.\n */\nexport const initialView: StaticView = {\n activeFilters: [],\n id: \"initial\",\n name: \"All\",\n}\n\n/**\n * A view from the app, without any search. Search isn't part of a view, so\n * views enter the table without it. A view without one is returned as is.\n */\nexport function withoutSearch<T extends View>(view: T): T {\n if (!view.activeFilters.some(isSearchFilter)) return view\n return {\n ...view,\n activeFilters: view.activeFilters.filter(\n (filter) => !isSearchFilter(filter)\n ),\n }\n}\n\n/**\n * A duplicate of a view under a new name. It's a new view, so it doesn't keep\n * the original's id.\n */\nexport function viewDuplicate(\n { id: _id, ...view }: View,\n name: string\n): Omit<SavedView, \"id\"> {\n return { ...view, name }\n}\n\n/**\n * Whether a view can be renamed, deleted, or saved over. Static views can't,\n * and neither can a view that isn't saved yet, since updates are matched by id.\n */\nexport function isViewEditable(view: View, savedViews: SavedView[]) {\n return view.id !== undefined && savedViews.includes(view)\n}\n\n/**\n * Whether the table's filters, sort, or visible columns differ from a view.\n * Filters match by name, operator, scope, and value, in any order; labels are\n * display-only. Sort and visible columns count only when both the view and the\n * table have them. Column names match as given, in any order, so resolve them\n * against the table's columns first to ignore ones that are gone.\n */\nexport function isViewModified(\n view: View,\n { activeFilters, sort, visibleColumnNames }: Omit<View, \"id\" | \"name\">\n) {\n if (view.sort && sort &&
|
|
1
|
+
{"version":3,"file":"views.js","sources":["../../../src/components/DataTable/views.ts"],"sourcesContent":["import type { Sort } from \"./DataTable\"\nimport type { ActiveFilter } from \"./FilterTypes\"\nimport { isSearchFilter } from \"./useSearchFilter\"\n\n/** A static or saved view. */\nexport interface View {\n /** A search (`q`) filter is ignored; applying a view keeps the search. */\n activeFilters: ActiveFilter[]\n /**\n * Required on a static view. A saved view gets one from the consumer once\n * it's saved.\n */\n id?: number | string\n name: string\n /** Omit to leave the current sort unchanged when applied. */\n sort?: Sort\n /**\n * The columns the view shows. A hideable column it doesn't name is hidden,\n * so a column added later stays out of the view until it's saved with it.\n * Omit to leave the current column visibility unchanged when applied.\n */\n visibleColumnNames?: string[]\n}\n\n/** A user-created view, stored by the consumer. */\nexport type SavedView = View\n\n/** An app-provided view. Read-only. */\nexport type StaticView = View & { id: number | string }\n\n/**\n * Always listed, so there's a view to fall back to. Added before the static\n * views unless one of them uses its id, which replaces it.\n */\nexport const initialView: StaticView = {\n activeFilters: [],\n id: \"initial\",\n name: \"All\",\n}\n\n/**\n * A view from the app, without any search. Search isn't part of a view, so\n * views enter the table without it. A view without one is returned as is.\n */\nexport function withoutSearch<T extends View>(view: T): T {\n if (!view.activeFilters.some(isSearchFilter)) return view\n return {\n ...view,\n activeFilters: view.activeFilters.filter(\n (filter) => !isSearchFilter(filter)\n ),\n }\n}\n\n/**\n * A duplicate of a view under a new name. It's a new view, so it doesn't keep\n * the original's id.\n */\nexport function viewDuplicate(\n { id: _id, ...view }: View,\n name: string\n): Omit<SavedView, \"id\"> {\n return { ...view, name }\n}\n\n/**\n * Whether a view can be renamed, deleted, or saved over. Static views can't,\n * and neither can a view that isn't saved yet, since updates are matched by id.\n */\nexport function isViewEditable(view: View, savedViews: SavedView[]) {\n return view.id !== undefined && savedViews.includes(view)\n}\n\n/**\n * Whether the table's filters, sort, or visible columns differ from a view.\n * Filters match by name, operator, scope, and value, in any order; labels are\n * display-only. Sort and visible columns count only when both the view and the\n * table have them. Column names match as given, in any order, so resolve them\n * against the table's columns first to ignore ones that are gone.\n */\nexport function isViewModified(\n view: View,\n { activeFilters, sort, visibleColumnNames }: Omit<View, \"id\" | \"name\">\n) {\n if (view.sort && sort && view.sort !== sort) return true\n if (\n view.visibleColumnNames &&\n visibleColumnNames &&\n !isSameNames(view.visibleColumnNames, visibleColumnNames)\n )\n return true\n // Each saved filter matches one current filter, so repeats count.\n const unmatched = [...view.activeFilters]\n return (\n activeFilters.length !== unmatched.length ||\n !activeFilters.every((filter) => {\n const index = unmatched.findIndex((saved) => isSameFilter(saved, filter))\n if (index === -1) return false\n unmatched.splice(index, 1)\n return true\n })\n )\n}\n\nfunction isSameFilter(a: ActiveFilter, b: ActiveFilter) {\n return (\n a.name === b.name &&\n a.operator === b.operator &&\n a.scope === b.scope &&\n isSameValue(a.value, b.value)\n )\n}\n\n// Filter values are primitives or flat arrays, such as ranges. Arrays match\n// only in the same order.\nfunction isSameValue(a: unknown, b: unknown) {\n if (!Array.isArray(a) || !Array.isArray(b)) return a === b\n return a.length === b.length && a.every((item, index) => item === b[index])\n}\n\nfunction isSameNames(a: string[], b: string[]) {\n return a.length === b.length && a.every((name) => b.includes(name))\n}\n"],"names":[],"mappings":";;AA8BA;;;AAGG;AACI,MAAM,WAAW,GAAe;AACrC,IAAA,aAAa,EAAE,EAAE;AACjB,IAAA,EAAE,EAAE,SAAS;AACb,IAAA,IAAI,EAAE,KAAK;;AAGb;;;AAGG;AACG,SAAU,aAAa,CAAiB,IAAO,EAAA;IACnD,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC;AAAE,QAAA,OAAO,IAAI;IACzD,OAAO;AACL,QAAA,GAAG,IAAI;AACP,QAAA,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CACtC,CAAC,MAAM,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CACpC;KACF;AACH;AAEA;;;AAGG;AACG,SAAU,aAAa,CAC3B,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAQ,EAC1B,IAAY,EAAA;AAEZ,IAAA,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE;AAC1B;AAEA;;;AAGG;AACG,SAAU,cAAc,CAAC,IAAU,EAAE,UAAuB,EAAA;AAChE,IAAA,OAAO,IAAI,CAAC,EAAE,KAAK,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC3D;AAEA;;;;;;AAMG;AACG,SAAU,cAAc,CAC5B,IAAU,EACV,EAAE,aAAa,EAAE,IAAI,EAAE,kBAAkB,EAA6B,EAAA;IAEtE,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,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AI,EAAE,KAAK,KAAK,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;AAC7E;AAEA,SAAS,WAAW,CAAC,CAAW,EAAE,CAAW,EAAA;IAC3C,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACrE;;;;"}
|
|
@@ -12,7 +12,7 @@ import { IconButton } from './IconButton.js';
|
|
|
12
12
|
*/
|
|
13
13
|
const ActionsDropdownIconButton = forwardRef(({ "aria-label": ariaLabel, className, kind = "ghost", tooltip, ...restProps }, ref) => {
|
|
14
14
|
const contextProps = useContext(DropdownTriggerContext);
|
|
15
|
-
const nameProps = tooltip
|
|
15
|
+
const nameProps = tooltip?.trim()
|
|
16
16
|
? { "aria-label": ariaLabel, tooltip }
|
|
17
17
|
: { "aria-label": ariaLabel ?? "Actions" };
|
|
18
18
|
return (React.createElement(IconButton, { ref: ref, ...restProps, ...contextProps, ...nameProps, className: classNames(className, "tds-btn--actions-dropdown"), fullWidth: false, icon: React.createElement(Icon, { className: "actions-icon", symbol: "general#three-dots", "aria-hidden": true }), kind: kind, loading: undefined, prefix: undefined, suffix: undefined }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsDropdownIconButton.js","sources":["../../../src/components/button/ActionsDropdownIconButton.tsx"],"sourcesContent":["import { DropdownTriggerContext } from \"@components/dropdown/DropdownTriggerContext\"\nimport { type TooltipPlacement } from \"@components/internal/tooltip\"\nimport { ComponentSize } from \"@utilities/buttonLinkShared\"\nimport Icon from \"@utilities/Icon\"\nimport classNames from \"classnames\"\nimport React, { forwardRef, useContext } from \"react\"\n\nimport { IconButton, IconButtonBaseProps } from \"./IconButton\"\n\nexport type ActionsDropdownIconButtonProps = Omit<\n IconButtonBaseProps,\n \"aria-label\" | \"icon\" | \"kind\" | \"loading\" | \"size\"\n> & {\n /**\n * Accessible name. Defaults to `\"Actions\"` when `tooltip` is not set.\n * Override when a page has several actions menus that need\n * distinguishing (e.g. `\"Actions for Jane Doe\"`).\n */\n \"aria-label\"?: string\n /**\n * Not supported — an actions trigger is a fixed-size icon button and\n * shouldn't stretch to fill a container. Always rendered as `false`.\n */\n fullWidth?: never\n /** Not supported — the vertical ellipsis is the component's identity. */\n icon?: never\n /**\n * Only `\"ghost\"` and `\"neutral\"` are supported treatments for an actions\n * trigger. Defaults to `\"ghost\"`.\n */\n kind?: \"ghost\" | \"neutral\"\n /**\n * Not supported — `.tds-btn--loading` hides every non-spinner child, so a\n * loading actions button would render a bare spinner with no glyph.\n */\n loading?: never\n /**\n * Not supported — same reasoning as `suffix`: total control over the\n * button's contents, and no slot besides the fixed ellipsis icon.\n */\n prefix?: never\n /**\n * `xs` is excluded — at 20px effective height it falls below the WCAG 2.2\n * AA 24×24 minimum target size, and an icon-only button has no text\n * content to widen it past the minimum.\n */\n size?: Exclude<ComponentSize, \"xs\">\n /** Not supported — no caret, and nothing else in the suffix slot. */\n suffix?: never\n /** Text shown on hover and focus. Without `aria-label`, it is also used as the `aria-label`. With `aria-label`, start the `aria-label` with the same text (e.g. tooltip `\"Delete\"`, aria-label `\"Delete, 3 selected\"`). The tooltip itself is hidden from screen readers. Ignores `aria-labelledby`. Never opens on hover while `disabled`, and opens on keyboard focus only with `focusableWhenDisabled`, so don't rely on it to explain why the button is disabled. */\n tooltip?: string\n /** Where the tooltip renders relative to the button. Default `\"bottom\"`. Has no effect without `tooltip`. */\n tooltipPlacement?: TooltipPlacement\n}\n\n/**\n * An icon-only dropdown trigger with a vertical-ellipsis glyph and no\n * caret, for action menus where a caret is visually redundant.\n *\n * @component\n */\nexport const ActionsDropdownIconButton = forwardRef<\n HTMLButtonElement,\n ActionsDropdownIconButtonProps\n>(\n (\n {\n \"aria-label\": ariaLabel,\n className,\n kind = \"ghost\",\n tooltip,\n ...restProps\n }: ActionsDropdownIconButtonProps,\n ref\n ) => {\n const contextProps = useContext(DropdownTriggerContext)\n const nameProps = tooltip\n ? { \"aria-label\": ariaLabel, tooltip }\n : { \"aria-label\": ariaLabel ?? \"Actions\" }\n return (\n <IconButton\n ref={ref}\n {...restProps}\n {...contextProps}\n {...nameProps}\n className={classNames(className, \"tds-btn--actions-dropdown\")}\n fullWidth={false}\n icon={\n <Icon\n className=\"actions-icon\"\n symbol=\"general#three-dots\"\n aria-hidden\n />\n }\n kind={kind}\n loading={undefined}\n prefix={undefined}\n suffix={undefined}\n />\n )\n }\n)\n\nActionsDropdownIconButton.displayName = \"ActionsDropdownIconButton\"\n"],"names":[],"mappings":";;;;;;AAuDA;;;;;AAKG;AACI,MAAM,yBAAyB,GAAG,UAAU,CAIjD,CACE,EACE,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,IAAI,GAAG,OAAO,EACd,OAAO,EACP,GAAG,SAAS,EACmB,EACjC,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,UAAU,CAAC,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ActionsDropdownIconButton.js","sources":["../../../src/components/button/ActionsDropdownIconButton.tsx"],"sourcesContent":["import { DropdownTriggerContext } from \"@components/dropdown/DropdownTriggerContext\"\nimport { type TooltipPlacement } from \"@components/internal/tooltip\"\nimport { ComponentSize } from \"@utilities/buttonLinkShared\"\nimport Icon from \"@utilities/Icon\"\nimport classNames from \"classnames\"\nimport React, { forwardRef, useContext } from \"react\"\n\nimport { IconButton, IconButtonBaseProps } from \"./IconButton\"\n\nexport type ActionsDropdownIconButtonProps = Omit<\n IconButtonBaseProps,\n \"aria-label\" | \"icon\" | \"kind\" | \"loading\" | \"size\"\n> & {\n /**\n * Accessible name. Defaults to `\"Actions\"` when `tooltip` is not set.\n * Override when a page has several actions menus that need\n * distinguishing (e.g. `\"Actions for Jane Doe\"`).\n */\n \"aria-label\"?: string\n /**\n * Not supported — an actions trigger is a fixed-size icon button and\n * shouldn't stretch to fill a container. Always rendered as `false`.\n */\n fullWidth?: never\n /** Not supported — the vertical ellipsis is the component's identity. */\n icon?: never\n /**\n * Only `\"ghost\"` and `\"neutral\"` are supported treatments for an actions\n * trigger. Defaults to `\"ghost\"`.\n */\n kind?: \"ghost\" | \"neutral\"\n /**\n * Not supported — `.tds-btn--loading` hides every non-spinner child, so a\n * loading actions button would render a bare spinner with no glyph.\n */\n loading?: never\n /**\n * Not supported — same reasoning as `suffix`: total control over the\n * button's contents, and no slot besides the fixed ellipsis icon.\n */\n prefix?: never\n /**\n * `xs` is excluded — at 20px effective height it falls below the WCAG 2.2\n * AA 24×24 minimum target size, and an icon-only button has no text\n * content to widen it past the minimum.\n */\n size?: Exclude<ComponentSize, \"xs\">\n /** Not supported — no caret, and nothing else in the suffix slot. */\n suffix?: never\n /** Text shown on hover and focus. Without `aria-label`, it is also used as the `aria-label`. With `aria-label`, start the `aria-label` with the same text (e.g. tooltip `\"Delete\"`, aria-label `\"Delete, 3 selected\"`). The tooltip itself is hidden from screen readers. Ignores `aria-labelledby`. Never opens on hover while `disabled`, and opens on keyboard focus only with `focusableWhenDisabled`, so don't rely on it to explain why the button is disabled. */\n tooltip?: string\n /** Where the tooltip renders relative to the button. Default `\"bottom\"`. Has no effect without `tooltip`. */\n tooltipPlacement?: TooltipPlacement\n}\n\n/**\n * An icon-only dropdown trigger with a vertical-ellipsis glyph and no\n * caret, for action menus where a caret is visually redundant.\n *\n * @component\n */\nexport const ActionsDropdownIconButton = forwardRef<\n HTMLButtonElement,\n ActionsDropdownIconButtonProps\n>(\n (\n {\n \"aria-label\": ariaLabel,\n className,\n kind = \"ghost\",\n tooltip,\n ...restProps\n }: ActionsDropdownIconButtonProps,\n ref\n ) => {\n const contextProps = useContext(DropdownTriggerContext)\n const nameProps = tooltip?.trim()\n ? { \"aria-label\": ariaLabel, tooltip }\n : { \"aria-label\": ariaLabel ?? \"Actions\" }\n return (\n <IconButton\n ref={ref}\n {...restProps}\n {...contextProps}\n {...nameProps}\n className={classNames(className, \"tds-btn--actions-dropdown\")}\n fullWidth={false}\n icon={\n <Icon\n className=\"actions-icon\"\n symbol=\"general#three-dots\"\n aria-hidden\n />\n }\n kind={kind}\n loading={undefined}\n prefix={undefined}\n suffix={undefined}\n />\n )\n }\n)\n\nActionsDropdownIconButton.displayName = \"ActionsDropdownIconButton\"\n"],"names":[],"mappings":";;;;;;AAuDA;;;;;AAKG;AACI,MAAM,yBAAyB,GAAG,UAAU,CAIjD,CACE,EACE,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,IAAI,GAAG,OAAO,EACd,OAAO,EACP,GAAG,SAAS,EACmB,EACjC,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,UAAU,CAAC,sBAAsB,CAAC;AACvD,IAAA,MAAM,SAAS,GAAG,OAAO,EAAE,IAAI;AAC7B,UAAE,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO;UAClC,EAAE,YAAY,EAAE,SAAS,IAAI,SAAS,EAAE;IAC5C,QACE,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EACT,GAAG,EAAE,GAAG,EAAA,GACJ,SAAS,EAAA,GACT,YAAY,EAAA,GACZ,SAAS,EACb,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,2BAA2B,CAAC,EAC7D,SAAS,EAAE,KAAK,EAChB,IAAI,EACF,oBAAC,IAAI,EAAA,EACH,SAAS,EAAC,cAAc,EACxB,MAAM,EAAC,oBAAoB,EAAA,aAAA,EAAA,IAAA,EAAA,CAE3B,EAEJ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,SAAS,EAClB,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,SAAS,EAAA,CACjB;AAEN,CAAC;AAGH,yBAAyB,CAAC,WAAW,GAAG,2BAA2B;;;;"}
|
|
@@ -13,7 +13,7 @@ import { BaseButton } from './BaseButton.js';
|
|
|
13
13
|
*/
|
|
14
14
|
const IconButton = forwardRef(({ className, icon, tooltip, tooltipPlacement = "bottom", ...restProps }, ref) => {
|
|
15
15
|
const iconOnlyClassName = classNames("tds-btn--icononly", className);
|
|
16
|
-
if (tooltip) {
|
|
16
|
+
if (tooltip?.trim()) {
|
|
17
17
|
const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...buttonProps } = restProps;
|
|
18
18
|
return (React.createElement(Tooltip, { content: tooltip, placement: tooltipPlacement, visualOnly: true },
|
|
19
19
|
React.createElement(BaseButton, { ...buttonProps, "aria-label": ariaLabel || tooltip, label: icon, className: iconOnlyClassName, ref: ref })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sources":["../../../src/components/button/IconButton.tsx"],"sourcesContent":["import \"./btn.css\"\n\nimport { Tooltip, type TooltipPlacement } from \"@components/internal/tooltip\"\nimport classNames from \"classnames\"\nimport React, { forwardRef } from \"react\"\n\nimport { BaseButton, BaseButtonElementProps } from \"./BaseButton\"\n\ntype IconButtonSharedProps = Omit<BaseButtonElementProps, \"label\"> & {\n /** The icon to display in the button. Set via story args for non-primitive values. */\n icon: React.ReactNode\n}\n\nexport type IconButtonBaseProps = IconButtonSharedProps & {\n /** Accessible label. Required for icon-only buttons to provide context about the button's purpose. */\n \"aria-label\": string\n}\n\ntype IconButtonTooltipProps = {\n /** Accessible label. Required for icon-only buttons to provide context about the button's purpose. Not required when `tooltip` is set. When both are set, this is the name and the tooltip is visual only. */\n \"aria-label\"?: string\n /** Text shown on hover and focus. Without `aria-label`, it is also used as the `aria-label`. With `aria-label`, start the `aria-label` with the same text (e.g. tooltip `\"Delete\"`, aria-label `\"Delete, 3 selected\"`). The tooltip itself is hidden from screen readers. Ignores `aria-labelledby`. Never opens on hover while `disabled` or `loading`, and opens on keyboard focus only with `focusableWhenDisabled`, so don't rely on it to explain why the button is disabled. */\n tooltip: string\n}\n\ntype IconButtonAriaLabelProps = {\n /** Accessible label. Required for icon-only buttons to provide context about the button's purpose. Not required when `tooltip` is set. When both are set, this is the name and the tooltip is visual only. */\n \"aria-label\": string\n /** Text shown on hover and focus. Without `aria-label`, it is also used as the `aria-label`. With `aria-label`, start the `aria-label` with the same text (e.g. tooltip `\"Delete\"`, aria-label `\"Delete, 3 selected\"`). The tooltip itself is hidden from screen readers. Ignores `aria-labelledby`. Never opens on hover while `disabled` or `loading`, and opens on keyboard focus only with `focusableWhenDisabled`, so don't rely on it to explain why the button is disabled. */\n tooltip?: string\n}\n\n/**\n * An icon-only button needs a name: `aria-label`, `tooltip`, or both.\n * `IconButtonAriaLabelProps` is declared last so that a missing name\n * reports \"aria-label is missing\", not \"tooltip is missing\".\n */\ntype IconButtonNameProps = IconButtonAriaLabelProps | IconButtonTooltipProps\n\nexport type IconButtonProps = IconButtonSharedProps &\n IconButtonNameProps & {\n /** Where the tooltip renders relative to the button. Default `\"bottom\"`. Has no effect without `tooltip`. */\n tooltipPlacement?: TooltipPlacement\n }\n\n/**\n * An icon-only button component that renders as a button element.\n * Requires an icon, and an aria-label or tooltip for accessibility.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/buttons-icon-button--docs | Storybook Documentation}\n * @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n className,\n icon,\n tooltip,\n tooltipPlacement = \"bottom\",\n ...restProps\n }: IconButtonProps,\n ref\n ) => {\n const iconOnlyClassName = classNames(\"tds-btn--icononly\", className)\n\n if (tooltip) {\n const {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...buttonProps\n } = restProps\n\n return (\n <Tooltip content={tooltip} placement={tooltipPlacement} visualOnly>\n <BaseButton\n {...buttonProps}\n aria-label={ariaLabel || tooltip}\n label={icon}\n className={iconOnlyClassName}\n ref={ref}\n />\n </Tooltip>\n )\n }\n\n return (\n <BaseButton\n {...restProps}\n label={icon}\n className={iconOnlyClassName}\n ref={ref}\n />\n )\n }\n)\n\nIconButton.displayName = \"IconButton\"\n"],"names":[],"mappings":";;;;;AA6CA;;;;;;;AAOG;AACI,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EACE,SAAS,EACT,IAAI,EACJ,OAAO,EACP,gBAAgB,GAAG,QAAQ,EAC3B,GAAG,SAAS,EACI,EAClB,GAAG,KACD;IACF,MAAM,iBAAiB,GAAG,UAAU,CAAC,mBAAmB,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"IconButton.js","sources":["../../../src/components/button/IconButton.tsx"],"sourcesContent":["import \"./btn.css\"\n\nimport { Tooltip, type TooltipPlacement } from \"@components/internal/tooltip\"\nimport classNames from \"classnames\"\nimport React, { forwardRef } from \"react\"\n\nimport { BaseButton, BaseButtonElementProps } from \"./BaseButton\"\n\ntype IconButtonSharedProps = Omit<BaseButtonElementProps, \"label\"> & {\n /** The icon to display in the button. Set via story args for non-primitive values. */\n icon: React.ReactNode\n}\n\nexport type IconButtonBaseProps = IconButtonSharedProps & {\n /** Accessible label. Required for icon-only buttons to provide context about the button's purpose. */\n \"aria-label\": string\n}\n\ntype IconButtonTooltipProps = {\n /** Accessible label. Required for icon-only buttons to provide context about the button's purpose. Not required when `tooltip` is set. When both are set, this is the name and the tooltip is visual only. */\n \"aria-label\"?: string\n /** Text shown on hover and focus. Without `aria-label`, it is also used as the `aria-label`. With `aria-label`, start the `aria-label` with the same text (e.g. tooltip `\"Delete\"`, aria-label `\"Delete, 3 selected\"`). The tooltip itself is hidden from screen readers. Ignores `aria-labelledby`. Never opens on hover while `disabled` or `loading`, and opens on keyboard focus only with `focusableWhenDisabled`, so don't rely on it to explain why the button is disabled. */\n tooltip: string\n}\n\ntype IconButtonAriaLabelProps = {\n /** Accessible label. Required for icon-only buttons to provide context about the button's purpose. Not required when `tooltip` is set. When both are set, this is the name and the tooltip is visual only. */\n \"aria-label\": string\n /** Text shown on hover and focus. Without `aria-label`, it is also used as the `aria-label`. With `aria-label`, start the `aria-label` with the same text (e.g. tooltip `\"Delete\"`, aria-label `\"Delete, 3 selected\"`). The tooltip itself is hidden from screen readers. Ignores `aria-labelledby`. Never opens on hover while `disabled` or `loading`, and opens on keyboard focus only with `focusableWhenDisabled`, so don't rely on it to explain why the button is disabled. */\n tooltip?: string\n}\n\n/**\n * An icon-only button needs a name: `aria-label`, `tooltip`, or both.\n * `IconButtonAriaLabelProps` is declared last so that a missing name\n * reports \"aria-label is missing\", not \"tooltip is missing\".\n */\ntype IconButtonNameProps = IconButtonAriaLabelProps | IconButtonTooltipProps\n\nexport type IconButtonProps = IconButtonSharedProps &\n IconButtonNameProps & {\n /** Where the tooltip renders relative to the button. Default `\"bottom\"`. Has no effect without `tooltip`. */\n tooltipPlacement?: TooltipPlacement\n }\n\n/**\n * An icon-only button component that renders as a button element.\n * Requires an icon, and an aria-label or tooltip for accessibility.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/buttons-icon-button--docs | Storybook Documentation}\n * @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n className,\n icon,\n tooltip,\n tooltipPlacement = \"bottom\",\n ...restProps\n }: IconButtonProps,\n ref\n ) => {\n const iconOnlyClassName = classNames(\"tds-btn--icononly\", className)\n\n if (tooltip?.trim()) {\n const {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...buttonProps\n } = restProps\n\n return (\n <Tooltip content={tooltip} placement={tooltipPlacement} visualOnly>\n <BaseButton\n {...buttonProps}\n aria-label={ariaLabel || tooltip}\n label={icon}\n className={iconOnlyClassName}\n ref={ref}\n />\n </Tooltip>\n )\n }\n\n return (\n <BaseButton\n {...restProps}\n label={icon}\n className={iconOnlyClassName}\n ref={ref}\n />\n )\n }\n)\n\nIconButton.displayName = \"IconButton\"\n"],"names":[],"mappings":";;;;;AA6CA;;;;;;;AAOG;AACI,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EACE,SAAS,EACT,IAAI,EACJ,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AAK,6BAA6B,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAA;AAEvE,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAC5D,+BAA+B,CAC7B,gBAAgB,CAAC,CAAC,CAAC,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,6BAA6B,CAC9B,CAAA;AAEH;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,EAC7C,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,wBAAwB,CAAC,CAAC,CAAC,qBAQ7B;AAED,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,QAAQ,EAAE,SAAS,CAAA;IACnB,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,KAAK,gCAAgC,GAAG,cAAc,CAAA;AAEtD,MAAM,MAAM,2BAA2B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAC/D,+BAA+B,CAC7B,mBAAmB,CAAC,CAAC,CAAC,EACtB,oBAAoB,EACpB,KAAK,EACL,gCAAgC,CACjC,CAAA;AAEH;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,EAChD,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,SAAS,EACb,EAAE,2BAA2B,CAAC,CAAC,CAAC,qBAYhC"}
|
|
@@ -12,7 +12,7 @@ import { useAnnounce } from '../../utilities/useAnnounce.js';
|
|
|
12
12
|
import { useId } from '../../utilities/useId.js';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import React, { useContext, useEffect } from 'react';
|
|
15
|
-
import { ListBoxLoadMoreItem, ComboBox as ComboBox$1, Label,
|
|
15
|
+
import { ListBoxLoadMoreItem, ComboBox as ComboBox$1, Label, Button, Popover, ListBox, Text, ListBoxItem, ListBoxSection, ComboBoxStateContext, Input, Collection } from 'react-aria-components/ComboBox';
|
|
16
16
|
import { Group } from 'react-aria-components/Group';
|
|
17
17
|
import { Header } from 'react-aria-components/Header';
|
|
18
18
|
|
|
@@ -23,6 +23,21 @@ function ClearButton() {
|
|
|
23
23
|
const state = useContext(ComboBoxStateContext);
|
|
24
24
|
return (React.createElement(IconButton, { "aria-label": "Clear", className: "tds-combo-box-clear-button", "data-input-empty": !state?.inputValue ? true : undefined, icon: React.createElement(Icon, { "aria-hidden": true, className: "tds-combo-box-clear-icon", symbol: "general#x" }), kind: "neutral-inline", onClick: () => state?.setInputValue(""), onMouseDown: (event) => event.preventDefault(), tabIndex: -1 }));
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* In multiple selection mode, Tab closes the list without changing the
|
|
28
|
+
* selection. React Aria would otherwise toggle the focused option, which
|
|
29
|
+
* removes a value when the list opened with a selected option focused.
|
|
30
|
+
*/
|
|
31
|
+
function ComboBoxInput(props) {
|
|
32
|
+
const state = useContext(ComboBoxStateContext);
|
|
33
|
+
return (React.createElement(Input, { ...props, onKeyDownCapture: (event) => {
|
|
34
|
+
if (event.key === "Tab" &&
|
|
35
|
+
state?.isOpen &&
|
|
36
|
+
state.selectionManager.selectionMode === "multiple") {
|
|
37
|
+
state.selectionManager.setFocusedKey(null);
|
|
38
|
+
}
|
|
39
|
+
} }));
|
|
40
|
+
}
|
|
26
41
|
function ErrorAnnouncement({ labelledBy }) {
|
|
27
42
|
const announce = useAnnounce();
|
|
28
43
|
const inputValue = useContext(ComboBoxStateContext)?.inputValue;
|
|
@@ -78,7 +93,7 @@ function ComboBox({ allowsEmptyCollection = true, children, className, descripti
|
|
|
78
93
|
!hideLabel && React.createElement(Label, { className: "tds-field-label" }, label),
|
|
79
94
|
React.createElement(Group, { className: "tds-field-control tds-combo-box-field" },
|
|
80
95
|
showSearchIcon && (React.createElement(Icon, { "aria-hidden": true, className: "tds-combo-box-search-icon", symbol: "general#search" })),
|
|
81
|
-
React.createElement(
|
|
96
|
+
React.createElement(ComboBoxInput, { "aria-invalid": invalid || undefined, className: "tds-combo-box-input", placeholder: placeholder }),
|
|
82
97
|
menuTrigger !== "focus" && !readOnly && (React.createElement(Button, { className: "tds-combo-box-button tds-btn tds-btn--infield" },
|
|
83
98
|
React.createElement(Icon, { "aria-hidden": true, symbol: "general#down-caret" }))),
|
|
84
99
|
showClearButton &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.js","sources":["../../../src/components/combo-box/ComboBox.tsx"],"sourcesContent":["import \"../button/btn.css\"\nimport \"../field/index.css\"\nimport \"./index.css\"\n\nimport { IconButton } from \"@components/button\"\nimport {\n LOADING_ANNOUNCEMENT_DELAY_MS,\n LoadingAnnouncement,\n} from \"@components/internal/LoadingAnnouncement\"\nimport LoadingSpinner from \"@components/internal/LoadingSpinner\"\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useAnnounce } from \"@utilities/useAnnounce\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { type ReactNode, useContext, useEffect } from \"react\"\nimport {\n Button,\n Collection,\n ComboBox as AriaComboBox,\n type ComboBoxProps as AriaComboBoxProps,\n ComboBoxStateContext,\n Input,\n type Key,\n Label,\n ListBox,\n ListBoxItem,\n type ListBoxItemProps,\n ListBoxLoadMoreItem,\n type ListBoxProps as AriaListBoxProps,\n ListBoxSection,\n type ListBoxSectionProps,\n Popover,\n Text,\n} from \"react-aria-components/ComboBox\"\nimport { Group } from \"react-aria-components/Group\"\nimport { Header } from \"react-aria-components/Header\"\n\nexport type ComboBoxSize = \"md\" | \"lg\"\n\nexport type ComboBoxLoadingState =\n | \"error\"\n | \"filtering\"\n | \"idle\"\n | \"loading\"\n | \"loadingMore\"\n | \"sorting\"\n\ntype ComboBoxChildren<T extends object> = NonNullable<\n AriaListBoxProps<T>[\"children\"]\n>\n\nexport interface ComboBoxProps<T extends object = object> {\n /**\n * If `true`, keeps typed text that does not match an option. Turn it on when\n * ComboBox is a standalone search and the suggestions are shortcuts. Leave it\n * off in forms, where the value needs to match one of the options.\n */\n allowsCustomValue?: boolean\n /** The contents of the listbox. */\n children: ComboBoxChildren<T>\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: ReactNode\n /** Disables the field and trigger button. */\n disabled?: boolean\n /** Custom filter function for determining if an item should appear in the list. */\n filter?: (textValue: string, inputValue: string) => boolean\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 /** Accessible label for the field. */\n label: string\n /**\n * Async loading state for the listbox.\n * - `\"loading\"`: while the collection is empty, replaces the empty state with a spinner.\n * - `\"loadingMore\"`: shows an inline spinner at the bottom of the listbox (use with `onLoadMore`).\n * - `\"filtering\"`: renders as `\"idle\"`, but tells screen reader users \"Loading\" when results are slow to arrive after typing stops.\n * - `\"error\"`: renders as `\"idle\"`, but reads the empty state (`renderEmptyState`) to screen reader users while the collection is empty.\n * - Other values render as `\"idle\"`.\n */\n loadingState?: ComboBoxLoadingState\n /**\n * The interaction that opens the popover.\n * - `\"input\"`: opens when the user enters text in the input.\n * - `\"focus\"`: opens when the user focuses (via click or keyboard) into the input.\n * - `\"manual\"`: opens only via the trigger button or arrow keys.\n * @default \"focus\"\n */\n menuTrigger?: \"focus\" | \"input\" | \"manual\"\n /**\n * Called when the selected value(s) change.\n * Receives `Key[]` when `selectionMode` is `\"multiple\"`, otherwise `Key | null`.\n */\n onChange?: ((value: Key | null) => void) | ((value: Key[]) => void)\n /** Called when the user scrolls near the bottom of the listbox. Pair with `loadingState` for infinite scroll. */\n onLoadMore?: () => void\n /** Placeholder text for the input. */\n placeholder?: string\n /** If `true`, allows the value to be read but not changed. */\n readOnly?: boolean\n /** Content to display when there are no items in the list. Defaults to \"No results\". */\n renderEmptyState?: ReactNode | (() => ReactNode)\n /** If `true`, appends an asterisk at the end of the label text. */\n required?: boolean\n /**\n * If `true`, renders a button after the input that clears its text. Only\n * applies when `menuTrigger` is `\"focus\"`, where no trigger button is rendered.\n */\n showClearButton?: boolean\n /** If `true`, renders a search icon before the input. */\n showSearchIcon?: boolean\n /** The size of the combo box. */\n size?: ComboBoxSize\n}\n\ntype AriaComboBoxPropsToOmit = \"slot\"\n\ntype AriaComboBoxPropsToInclude =\n | \"allowsEmptyCollection\"\n | \"defaultItems\"\n | \"defaultValue\"\n | \"disabledKeys\"\n | \"inputValue\"\n | \"items\"\n | \"name\"\n | \"onInputChange\"\n | \"selectionMode\"\n | \"value\"\n\nexport type ComboBoxElementProps<T extends object = object> =\n CombineAriaPropsWithCustomProps<\n AriaComboBoxProps<T, \"single\" | \"multiple\">,\n ComboBoxProps<T>,\n AriaComboBoxPropsToOmit,\n AriaComboBoxPropsToInclude\n >\n\nfunction resolveEmptyState(value: ReactNode | (() => ReactNode)): ReactNode {\n return typeof value === \"function\" ? value() : value\n}\n\nfunction ClearButton() {\n const state = useContext(ComboBoxStateContext)\n\n return (\n <IconButton\n aria-label=\"Clear\"\n className=\"tds-combo-box-clear-button\"\n data-input-empty={!state?.inputValue ? true : undefined}\n icon={\n <Icon\n aria-hidden\n className=\"tds-combo-box-clear-icon\"\n symbol=\"general#x\"\n />\n }\n kind=\"neutral-inline\"\n onClick={() => state?.setInputValue(\"\")}\n onMouseDown={(event) => event.preventDefault()}\n tabIndex={-1}\n />\n )\n}\n\nfunction ErrorAnnouncement({ labelledBy }: { labelledBy: string }) {\n const announce = useAnnounce()\n const inputValue = useContext(ComboBoxStateContext)?.inputValue\n\n useEffect(() => {\n const timeout = setTimeout(\n () => announce({ \"aria-labelledby\": labelledBy }),\n LOADING_ANNOUNCEMENT_DELAY_MS\n )\n return () => clearTimeout(timeout)\n }, [announce, inputValue, labelledBy])\n\n return null\n}\n\nfunction FilteringAnnouncement() {\n const state = useContext(ComboBoxStateContext)\n if (!state?.isOpen) return null\n\n return <LoadingAnnouncement key={state.inputValue} message=\"Loading\" />\n}\n\n/**\n * A combo box combines a text input with a filterable popover\n * listbox, allowing users to type to search and select from a list of options.\n *\n * It supports both single and multiple selection (`selectionMode`), custom filtering,\n * and asynchronous data loading with infinite scroll capabilities (`loadingState` and `onLoadMore`).\n * Collections can be either static or dynamic, managed via the `children`, `items`,\n * or `defaultItems` props. To construct the dropdown list, compose this component\n * with `ComboBoxItem` for individual options and `ComboBoxSection` for grouping.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-combobox--docs | Storybook Documentation}\n */\nexport function ComboBox<T extends object>({\n allowsEmptyCollection = true,\n children,\n className,\n description,\n disabled,\n filter,\n hideLabel,\n invalid,\n label,\n loadingState,\n menuTrigger = \"focus\",\n onChange,\n onLoadMore,\n placeholder,\n readOnly,\n renderEmptyState = \"No results\",\n required,\n showClearButton,\n showSearchIcon,\n size = \"md\",\n ...restProps\n}: ComboBoxElementProps<T>) {\n const emptyStateId = `tds-combo-box-empty-state-${useId()}`\n const combinedClassName = classNames(\n \"tds-field tds-combo-box\",\n {\n \"tds-combo-box--lg\": size === \"lg\",\n \"tds-field--lg\": size === \"lg\",\n },\n className\n )\n\n const loadMoreItem = onLoadMore && (\n <ListBoxLoadMoreItem\n className=\"tds-combo-box-load-more\"\n isLoading={loadingState === \"loadingMore\"}\n onLoadMore={onLoadMore}\n >\n <span className=\"tds-combo-box-loading-label--hidden\">Loading more</span>\n <LoadingSpinner />\n <LoadingAnnouncement message=\"Loading more\" />\n </ListBoxLoadMoreItem>\n )\n\n const renderChildren = () => {\n if (typeof children === \"function\") {\n return (\n <Collection items={restProps.items ?? restProps.defaultItems}>\n {children}\n </Collection>\n )\n }\n return children\n }\n\n return (\n // React Aria's ComboBox is generic over selection mode (M). We instantiate\n // it with the union \"single\" | \"multiple\" so value/defaultValue/selectionMode\n // accept both shapes. onChange still needs a cast because our type is a union\n // of function types (to allow narrower handlers like\n // `setValue: (Key|null) => void`), which isn't assignable to RAC's\n // single-function signature.\n <AriaComboBox<T, \"single\" | \"multiple\">\n {...restProps}\n allowsEmptyCollection={allowsEmptyCollection}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n defaultFilter={filter}\n isDisabled={disabled}\n isReadOnly={readOnly}\n isRequired={required}\n menuTrigger={menuTrigger}\n onChange={onChange as (value: Key | Key[] | null) => void}\n >\n {!hideLabel && <Label className=\"tds-field-label\">{label}</Label>}\n <Group className=\"tds-field-control tds-combo-box-field\">\n {showSearchIcon && (\n <Icon\n aria-hidden\n className=\"tds-combo-box-search-icon\"\n symbol=\"general#search\"\n />\n )}\n <Input\n aria-invalid={invalid || undefined}\n className=\"tds-combo-box-input\"\n placeholder={placeholder}\n />\n {menuTrigger !== \"focus\" && !readOnly && (\n <Button className=\"tds-combo-box-button tds-btn tds-btn--infield\">\n <Icon aria-hidden symbol=\"general#down-caret\" />\n </Button>\n )}\n {showClearButton &&\n menuTrigger === \"focus\" &&\n !readOnly &&\n !disabled && <ClearButton />}\n </Group>\n <Popover className=\"tds-combo-box-popover\">\n <ListBox\n className=\"tds-combo-box-list\"\n renderEmptyState={\n allowsEmptyCollection\n ? () => (\n <div className=\"tds-combo-box-empty-state\" id={emptyStateId}>\n {loadingState === \"error\" && (\n <ErrorAnnouncement labelledBy={emptyStateId} />\n )}\n {loadingState === \"loading\" ? (\n <>\n <span className=\"tds-combo-box-loading-label--hidden\">\n Loading\n </span>\n <LoadingSpinner />\n <LoadingAnnouncement message=\"Loading\" />\n </>\n ) : (\n resolveEmptyState(renderEmptyState)\n )}\n </div>\n )\n : undefined\n }\n >\n {renderChildren()}\n {loadMoreItem}\n </ListBox>\n {loadingState === \"filtering\" && <FilteringAnnouncement />}\n </Popover>\n {description && (\n <Text className=\"tds-field-description\" slot=\"description\">\n <Icon\n aria-hidden\n className=\"tds-field-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaComboBox>\n )\n}\n\nexport interface ComboBoxItemProps {\n /** Disables the item. */\n disabled?: boolean\n}\n\ntype AriaListBoxItemPropsToOmit = \"isDisabled\"\n\ntype AriaListBoxItemPropsToInclude = \"onAction\" | \"textValue\" | \"value\"\n\nexport type ComboBoxItemElementProps<T extends object = object> =\n CombineAriaPropsWithCustomProps<\n ListBoxItemProps<T>,\n ComboBoxItemProps,\n AriaListBoxItemPropsToOmit,\n AriaListBoxItemPropsToInclude\n >\n\n/**\n * A selectable option within a {@link ComboBox}. Renders as a listbox item.\n *\n * Provide an `id` (or `key` when rendering from a collection) to identify the\n * option, and `textValue` when the visible children are not plain text so\n * type-ahead and screen readers have a stable label to use.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-combobox--docs | Storybook Documentation}\n */\nexport function ComboBoxItem<T extends object>({\n className,\n disabled,\n ...restProps\n}: ComboBoxItemElementProps<T>) {\n return (\n <ListBoxItem\n {...restProps}\n className={classNames(\"tds-combo-box-list-item\", className)}\n isDisabled={disabled}\n />\n )\n}\n\nexport interface ComboBoxSectionProps {\n /** The items rendered within the section. */\n children: ReactNode\n /** Optional heading text rendered above the section's items. */\n title?: string\n}\n\ntype AriaListBoxSectionPropsToInclude = \"dependencies\"\n\nexport type ComboBoxSectionElementProps<T extends object = object> =\n CombineAriaPropsWithCustomProps<\n ListBoxSectionProps<T>,\n ComboBoxSectionProps,\n never,\n AriaListBoxSectionPropsToInclude\n >\n\n/**\n * A group of related {@link ComboBoxItem}s within a {@link ComboBox}. Renders\n * an optional `title` heading above its items.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-combobox--docs | Storybook Documentation}\n */\nexport function ComboBoxSection<T extends object>({\n children,\n className,\n title,\n ...restProps\n}: ComboBoxSectionElementProps<T>) {\n return (\n <ListBoxSection\n {...restProps}\n className={classNames(\"tds-combo-box-list-section\", className)}\n >\n {title && (\n <Header className=\"tds-combo-box-section-header\">{title}</Header>\n )}\n {children}\n </ListBoxSection>\n )\n}\n"],"names":["AriaComboBox"],"mappings":";;;;;;;;;;;;;;;;;;AA0IA,SAAS,iBA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AA8B,EAAA,CACrC;AACD,YAAA,WAAW,CACP,CACR,CACY;AAEnB;AAmBA;;;;;;;;;AASG;AACG,SAAU,YAAY,CAAmB,EAC7C,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EACgB,EAAA;IAC5B,QACE,oBAAC,WAAW,EAAA,EAAA,GACN,SAAS,EACb,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,SAAS,CAAC,EAC3D,UAAU,EAAE,QAAQ,EAAA,CACpB;AAEN;AAmBA;;;;;;AAMG;AACG,SAAU,eAAe,CAAmB,EAChD,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,SAAS,EACmB,EAAA;AAC/B,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAA,GACT,SAAS,EACb,SAAS,EAAE,UAAU,CAAC,4BAA4B,EAAE,SAAS,CAAC,EAAA;QAE7D,KAAK,KACJ,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,8BAA8B,EAAA,EAAE,KAAK,CAAU,CAClE;QACA,QAAQ,CACM;AAErB;;;;"}
|
|
1
|
+
{"version":3,"file":"ComboBox.js","sources":["../../../src/components/combo-box/ComboBox.tsx"],"sourcesContent":["import \"../button/btn.css\"\nimport \"../field/index.css\"\nimport \"./index.css\"\n\nimport { IconButton } from \"@components/button\"\nimport {\n LOADING_ANNOUNCEMENT_DELAY_MS,\n LoadingAnnouncement,\n} from \"@components/internal/LoadingAnnouncement\"\nimport LoadingSpinner from \"@components/internal/LoadingSpinner\"\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useAnnounce } from \"@utilities/useAnnounce\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { type ReactNode, useContext, useEffect } from \"react\"\nimport {\n Button,\n Collection,\n ComboBox as AriaComboBox,\n type ComboBoxProps as AriaComboBoxProps,\n ComboBoxStateContext,\n Input,\n type Key,\n Label,\n ListBox,\n ListBoxItem,\n type ListBoxItemProps,\n ListBoxLoadMoreItem,\n type ListBoxProps as AriaListBoxProps,\n ListBoxSection,\n type ListBoxSectionProps,\n Popover,\n Text,\n} from \"react-aria-components/ComboBox\"\nimport { Group } from \"react-aria-components/Group\"\nimport { Header } from \"react-aria-components/Header\"\n\nexport type ComboBoxSize = \"md\" | \"lg\"\n\nexport type ComboBoxLoadingState =\n | \"error\"\n | \"filtering\"\n | \"idle\"\n | \"loading\"\n | \"loadingMore\"\n | \"sorting\"\n\ntype ComboBoxChildren<T extends object> = NonNullable<\n AriaListBoxProps<T>[\"children\"]\n>\n\nexport interface ComboBoxProps<T extends object = object> {\n /**\n * If `true`, keeps typed text that does not match an option. Turn it on when\n * ComboBox is a standalone search and the suggestions are shortcuts. Leave it\n * off in forms, where the value needs to match one of the options.\n */\n allowsCustomValue?: boolean\n /** The contents of the listbox. */\n children: ComboBoxChildren<T>\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: ReactNode\n /** Disables the field and trigger button. */\n disabled?: boolean\n /** Custom filter function for determining if an item should appear in the list. */\n filter?: (textValue: string, inputValue: string) => boolean\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 /** Accessible label for the field. */\n label: string\n /**\n * Async loading state for the listbox.\n * - `\"loading\"`: while the collection is empty, replaces the empty state with a spinner.\n * - `\"loadingMore\"`: shows an inline spinner at the bottom of the listbox (use with `onLoadMore`).\n * - `\"filtering\"`: renders as `\"idle\"`, but tells screen reader users \"Loading\" when results are slow to arrive after typing stops.\n * - `\"error\"`: renders as `\"idle\"`, but reads the empty state (`renderEmptyState`) to screen reader users while the collection is empty.\n * - Other values render as `\"idle\"`.\n */\n loadingState?: ComboBoxLoadingState\n /**\n * The interaction that opens the popover.\n * - `\"input\"`: opens when the user enters text in the input.\n * - `\"focus\"`: opens when the user focuses (via click or keyboard) into the input.\n * - `\"manual\"`: opens only via the trigger button or arrow keys.\n * @default \"focus\"\n */\n menuTrigger?: \"focus\" | \"input\" | \"manual\"\n /**\n * Called when the selected value(s) change.\n * Receives `Key[]` when `selectionMode` is `\"multiple\"`, otherwise `Key | null`.\n */\n onChange?: ((value: Key | null) => void) | ((value: Key[]) => void)\n /** Called when the user scrolls near the bottom of the listbox. Pair with `loadingState` for infinite scroll. */\n onLoadMore?: () => void\n /** Placeholder text for the input. */\n placeholder?: string\n /** If `true`, allows the value to be read but not changed. */\n readOnly?: boolean\n /** Content to display when there are no items in the list. Defaults to \"No results\". */\n renderEmptyState?: ReactNode | (() => ReactNode)\n /** If `true`, appends an asterisk at the end of the label text. */\n required?: boolean\n /**\n * If `true`, renders a button after the input that clears its text. Only\n * applies when `menuTrigger` is `\"focus\"`, where no trigger button is rendered.\n */\n showClearButton?: boolean\n /** If `true`, renders a search icon before the input. */\n showSearchIcon?: boolean\n /** The size of the combo box. */\n size?: ComboBoxSize\n}\n\ntype AriaComboBoxPropsToOmit = \"slot\"\n\ntype AriaComboBoxPropsToInclude =\n | \"allowsEmptyCollection\"\n | \"defaultItems\"\n | \"defaultValue\"\n | \"disabledKeys\"\n | \"inputValue\"\n | \"items\"\n | \"name\"\n | \"onInputChange\"\n | \"selectionMode\"\n | \"value\"\n\nexport type ComboBoxElementProps<T extends object = object> =\n CombineAriaPropsWithCustomProps<\n AriaComboBoxProps<T, \"single\" | \"multiple\">,\n ComboBoxProps<T>,\n AriaComboBoxPropsToOmit,\n AriaComboBoxPropsToInclude\n >\n\nfunction resolveEmptyState(value: ReactNode | (() => ReactNode)): ReactNode {\n return typeof value === \"function\" ? value() : value\n}\n\nfunction ClearButton() {\n const state = useContext(ComboBoxStateContext)\n\n return (\n <IconButton\n aria-label=\"Clear\"\n className=\"tds-combo-box-clear-button\"\n data-input-empty={!state?.inputValue ? true : undefined}\n icon={\n <Icon\n aria-hidden\n className=\"tds-combo-box-clear-icon\"\n symbol=\"general#x\"\n />\n }\n kind=\"neutral-inline\"\n onClick={() => state?.setInputValue(\"\")}\n onMouseDown={(event) => event.preventDefault()}\n tabIndex={-1}\n />\n )\n}\n\n/**\n * In multiple selection mode, Tab closes the list without changing the\n * selection. React Aria would otherwise toggle the focused option, which\n * removes a value when the list opened with a selected option focused.\n */\nfunction ComboBoxInput(props: React.ComponentProps<typeof Input>) {\n const state = useContext(ComboBoxStateContext)\n\n return (\n <Input\n {...props}\n onKeyDownCapture={(event) => {\n if (\n event.key === \"Tab\" &&\n state?.isOpen &&\n state.selectionManager.selectionMode === \"multiple\"\n ) {\n state.selectionManager.setFocusedKey(null)\n }\n }}\n />\n )\n}\n\nfunction ErrorAnnouncement({ labelledBy }: { labelledBy: string }) {\n const announce = useAnnounce()\n const inputValue = useContext(ComboBoxStateContext)?.inputValue\n\n useEffect(() => {\n const timeout = setTimeout(\n () => announce({ \"aria-labelledby\": labelledBy }),\n LOADING_ANNOUNCEMENT_DELAY_MS\n )\n return () => clearTimeout(timeout)\n }, [announce, inputValue, labelledBy])\n\n return null\n}\n\nfunction FilteringAnnouncement() {\n const state = useContext(ComboBoxStateContext)\n if (!state?.isOpen) return null\n\n return <LoadingAnnouncement key={state.inputValue} message=\"Loading\" />\n}\n\n/**\n * A combo box combines a text input with a filterable popover\n * listbox, allowing users to type to search and select from a list of options.\n *\n * It supports both single and multiple selection (`selectionMode`), custom filtering,\n * and asynchronous data loading with infinite scroll capabilities (`loadingState` and `onLoadMore`).\n * Collections can be either static or dynamic, managed via the `children`, `items`,\n * or `defaultItems` props. To construct the dropdown list, compose this component\n * with `ComboBoxItem` for individual options and `ComboBoxSection` for grouping.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-combobox--docs | Storybook Documentation}\n */\nexport function ComboBox<T extends object>({\n allowsEmptyCollection = true,\n children,\n className,\n description,\n disabled,\n filter,\n hideLabel,\n invalid,\n label,\n loadingState,\n menuTrigger = \"focus\",\n onChange,\n onLoadMore,\n placeholder,\n readOnly,\n renderEmptyState = \"No results\",\n required,\n showClearButton,\n showSearchIcon,\n size = \"md\",\n ...restProps\n}: ComboBoxElementProps<T>) {\n const emptyStateId = `tds-combo-box-empty-state-${useId()}`\n const combinedClassName = classNames(\n \"tds-field tds-combo-box\",\n {\n \"tds-combo-box--lg\": size === \"lg\",\n \"tds-field--lg\": size === \"lg\",\n },\n className\n )\n\n const loadMoreItem = onLoadMore && (\n <ListBoxLoadMoreItem\n className=\"tds-combo-box-load-more\"\n isLoading={loadingState === \"loadingMore\"}\n onLoadMore={onLoadMore}\n >\n <span className=\"tds-combo-box-loading-label--hidden\">Loading more</span>\n <LoadingSpinner />\n <LoadingAnnouncement message=\"Loading more\" />\n </ListBoxLoadMoreItem>\n )\n\n const renderChildren = () => {\n if (typeof children === \"function\") {\n return (\n <Collection items={restProps.items ?? restProps.defaultItems}>\n {children}\n </Collection>\n )\n }\n return children\n }\n\n return (\n // React Aria's ComboBox is generic over selection mode (M). We instantiate\n // it with the union \"single\" | \"multiple\" so value/defaultValue/selectionMode\n // accept both shapes. onChange still needs a cast because our type is a union\n // of function types (to allow narrower handlers like\n // `setValue: (Key|null) => void`), which isn't assignable to RAC's\n // single-function signature.\n <AriaComboBox<T, \"single\" | \"multiple\">\n {...restProps}\n allowsEmptyCollection={allowsEmptyCollection}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n defaultFilter={filter}\n isDisabled={disabled}\n isReadOnly={readOnly}\n isRequired={required}\n menuTrigger={menuTrigger}\n onChange={onChange as (value: Key | Key[] | null) => void}\n >\n {!hideLabel && <Label className=\"tds-field-label\">{label}</Label>}\n <Group className=\"tds-field-control tds-combo-box-field\">\n {showSearchIcon && (\n <Icon\n aria-hidden\n className=\"tds-combo-box-search-icon\"\n symbol=\"general#search\"\n />\n )}\n <ComboBoxInput\n aria-invalid={invalid || undefined}\n className=\"tds-combo-box-input\"\n placeholder={placeholder}\n />\n {menuTrigger !== \"focus\" && !readOnly && (\n <Button className=\"tds-combo-box-button tds-btn tds-btn--infield\">\n <Icon aria-hidden symbol=\"general#down-caret\" />\n </Button>\n )}\n {showClearButton &&\n menuTrigger === \"focus\" &&\n !readOnly &&\n !disabled && <ClearButton />}\n </Group>\n <Popover className=\"tds-combo-box-popover\">\n <ListBox\n className=\"tds-combo-box-list\"\n renderEmptyState={\n allowsEmptyCollection\n ? () => (\n <div className=\"tds-combo-box-empty-state\" id={emptyStateId}>\n {loadingState === \"error\" && (\n <ErrorAnnouncement labelledBy={emptyStateId} />\n )}\n {loadingState === \"loading\" ? (\n <>\n <span className=\"tds-combo-box-loading-label--hidden\">\n Loading\n </span>\n <LoadingSpinner />\n <LoadingAnnouncement message=\"Loading\" />\n </>\n ) : (\n resolveEmptyState(renderEmptyState)\n )}\n </div>\n )\n : undefined\n }\n >\n {renderChildren()}\n {loadMoreItem}\n </ListBox>\n {loadingState === \"filtering\" && <FilteringAnnouncement />}\n </Popover>\n {description && (\n <Text className=\"tds-field-description\" slot=\"description\">\n <Icon\n aria-hidden\n className=\"tds-field-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaComboBox>\n )\n}\n\nexport interface ComboBoxItemProps {\n /** Disables the item. */\n disabled?: boolean\n}\n\ntype AriaListBoxItemPropsToOmit = \"isDisabled\"\n\ntype AriaListBoxItemPropsToInclude = \"onAction\" | \"textValue\" | \"value\"\n\nexport type ComboBoxItemElementProps<T extends object = object> =\n CombineAriaPropsWithCustomProps<\n ListBoxItemProps<T>,\n ComboBoxItemProps,\n AriaListBoxItemPropsToOmit,\n AriaListBoxItemPropsToInclude\n >\n\n/**\n * A selectable option within a {@link ComboBox}. Renders as a listbox item.\n *\n * Provide an `id` (or `key` when rendering from a collection) to identify the\n * option, and `textValue` when the visible children are not plain text so\n * type-ahead and screen readers have a stable label to use.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-combobox--docs | Storybook Documentation}\n */\nexport function ComboBoxItem<T extends object>({\n className,\n disabled,\n ...restProps\n}: ComboBoxItemElementProps<T>) {\n return (\n <ListBoxItem\n {...restProps}\n className={classNames(\"tds-combo-box-list-item\", className)}\n isDisabled={disabled}\n />\n )\n}\n\nexport interface ComboBoxSectionProps {\n /** The items rendered within the section. */\n children: ReactNode\n /** Optional heading text rendered above the section's items. */\n title?: string\n}\n\ntype AriaListBoxSectionPropsToInclude = \"dependencies\"\n\nexport type ComboBoxSectionElementProps<T extends object = object> =\n CombineAriaPropsWithCustomProps<\n ListBoxSectionProps<T>,\n ComboBoxSectionProps,\n never,\n AriaListBoxSectionPropsToInclude\n >\n\n/**\n * A group of related {@link ComboBoxItem}s within a {@link ComboBox}. Renders\n * an optional `title` heading above its items.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-combobox--docs | Storybook Documentation}\n */\nexport function ComboBoxSection<T extends object>({\n children,\n className,\n title,\n ...restProps\n}: ComboBoxSectionElementProps<T>) {\n return (\n <ListBoxSection\n {...restProps}\n className={classNames(\"tds-combo-box-list-section\", className)}\n >\n {title && (\n <Header className=\"tds-combo-box-section-header\">{title}</Header>\n )}\n {children}\n </ListBoxSection>\n )\n}\n"],"names":["AriaComboBox"],"mappings":";;;;;;;;;;;;;;;;;;AA0IA,SAAS,iBAAiB,CAAC,KAAoC,EAAA;AAC7D,IAAA,OAAO,OAAO,KAAK,KAAK,UAAU,GAAG,KAAK,EAAE,GAAG,KAAK;AACtD;AAEA,SAAS,WAAW,GAAA;AAClB,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,oBAAoB,CAAC;AAE9C,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EAAA,YAAA,EACE,OAAO,EAClB,SAAS,EAAC,4BAA4B,EAAA,kBAAA,EACpB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,EACvD,IAAI,EACF,KAAA,CAAA,aAAA,CAAC,IAAI,yBAEH,SAAS,EAAC,0BAA0B,EACpC,MAAM,EAAC,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,8BAA8B,EAAA,CACrC;AACD,YAAA,WAAW,CACP,CACR,CACY;AAEnB;AAmBA;;;;;;;;;AASG;AACG,SAAU,YAAY,CAAmB,EAC7C,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EACgB,EAAA;IAC5B,QACE,oBAAC,WAAW,EAAA,EAAA,GACN,SAAS,EACb,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,SAAS,CAAC,EAC3D,UAAU,EAAE,QAAQ,EAAA,CACpB;AAEN;AAmBA;;;;;;AAMG;AACG,SAAU,eAAe,CAAmB,EAChD,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,SAAS,EACmB,EAAA;AAC/B,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAA,GACT,SAAS,EACb,SAAS,EAAE,UAAU,CAAC,4BAA4B,EAAE,SAAS,CAAC,EAAA;QAE7D,KAAK,KACJ,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,8BAA8B,EAAA,EAAE,KAAK,CAAU,CAClE;QACA,QAAQ,CACM;AAErB;;;;"}
|
|
@@ -13,7 +13,7 @@ interface CurrencyInputBaseProps {
|
|
|
13
13
|
expand?: boolean;
|
|
14
14
|
/** Triggers invalid state (error border, error description, aria-invalid). */
|
|
15
15
|
invalid?: boolean;
|
|
16
|
-
/** BCP 47 locale used to derive the prefix and the screen-reader currency name. Defaults to the
|
|
16
|
+
/** BCP 47 locale used to derive the prefix and the screen-reader currency name. Defaults to the Tapestry locale (the nearest `I18nProvider`, then `setLocale`, then the browser locale). Only visibly changes anything under `currencyDisplay="symbol"` — under the default `narrowSymbol` a bad locale silently falls back rather than throwing. */
|
|
17
17
|
locale?: string;
|
|
18
18
|
/** Visual size — cascades to the prefix and input via Field's font-size custom property. Defaults to 'md'. */
|
|
19
19
|
size?: CurrencyInputSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyInput.d.ts","sourceRoot":"","sources":["../../../src/components/currency-input/CurrencyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"CurrencyInput.d.ts","sourceRoot":"","sources":["../../../src/components/currency-input/CurrencyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAMpB,OAAO,KAAK,EAAE,EAAc,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAEnE,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAA;AAE3C,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,cAAc,GAAG,QAAQ,CAAA;AAuCrE,UAAU,sBAAsB;IAC9B,qVAAqV;IACrV,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6GAA6G;IAC7G,eAAe,CAAC,EAAE,oBAAoB,CAAA;IACtC,sEAAsE;IACtE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,wFAAwF;IACxF,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qVAAqV;IACrV,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8GAA8G;IAC9G,IAAI,CAAC,EAAE,iBAAiB,CAAA;CACzB;AAED,UAAU,sBAAuB,SAAQ,sBAAsB;IAC7D,iBAAiB,CAAC,EAAE,KAAK,CAAA;IACzB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,yBAAyB;IACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,UAAU,+BAAgC,SAAQ,sBAAsB;IACtE,iBAAiB,EAAE,MAAM,CAAA;IACzB,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,MAAM,MAAM,kBAAkB,GAC1B,+BAA+B,GAC/B,sBAAsB,CAAA;AAE1B;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,kBAAkB,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,CACzD,GACC,kBAAkB,CAAA;AAEpB;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,oGAwExB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Field } from '../field/Field.js';
|
|
2
|
+
import { useTapestryLocale } from '../../utilities/locale.js';
|
|
2
3
|
import { useId } from '../../utilities/useId.js';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import React__default, { forwardRef } from 'react';
|
|
@@ -40,7 +41,9 @@ function currencyNameFor(currency, locale) {
|
|
|
40
41
|
* @component
|
|
41
42
|
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-currencyinput--docs | Storybook Documentation}
|
|
42
43
|
*/
|
|
43
|
-
const CurrencyInput = forwardRef(function CurrencyInput({ "aria-labelledby": ariaLabelledBy, className, currency = "USD", currencyDisplay = "narrowSymbol", description, expand, hideLabel, id, invalid, label, locale, size = "md", ...restProps }, ref) {
|
|
44
|
+
const CurrencyInput = forwardRef(function CurrencyInput({ "aria-labelledby": ariaLabelledBy, className, currency = "USD", currencyDisplay = "narrowSymbol", description, expand, hideLabel, id, invalid, label, locale: localeProp, size = "md", ...restProps }, ref) {
|
|
45
|
+
const tapestryLocale = useTapestryLocale();
|
|
46
|
+
const locale = localeProp ?? tapestryLocale;
|
|
44
47
|
const stableId = useId();
|
|
45
48
|
const inputId = id || `tds-currency-input-${stableId}`;
|
|
46
49
|
const descriptionId = description ? `${inputId}-description` : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyInput.js","sources":["../../../src/components/currency-input/CurrencyInput.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { Field } from \"@components/field\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { forwardRef, type InputHTMLAttributes } from \"react\"\n\nexport type CurrencyInputSize = \"lg\" | \"md\"\n\nexport type CurrencyInputDisplay = \"code\" | \"narrowSymbol\" | \"symbol\"\n\nfunction symbolFor(\n currency: string,\n currencyDisplay: CurrencyInputDisplay,\n locale?: string\n): string {\n try {\n return (\n new Intl.NumberFormat(locale, {\n currency,\n currencyDisplay,\n style: \"currency\",\n })\n .formatToParts(0)\n .find((part) => part.type === \"currency\")?.value ?? currency\n )\n } catch {\n return currency\n }\n}\n\nconst UNKNOWN_CURRENCY_NAME = \"Unknown currency.\"\n\nfunction currencyNameFor(currency: string, locale?: string): string {\n if (!Intl.supportedValuesOf(\"currency\").includes(currency.toUpperCase())) {\n return UNKNOWN_CURRENCY_NAME\n }\n\n try {\n const name = new Intl.DisplayNames(locale, { type: \"currency\" }).of(\n currency\n )\n return name ? `${name}.` : UNKNOWN_CURRENCY_NAME\n } catch {\n return UNKNOWN_CURRENCY_NAME\n }\n}\n\ninterface CurrencyInputBaseProps {\n /** ISO 4217 currency code (e.g. `\"USD\"`, `\"CAD\"`, `\"EUR\"`). Defaults to `\"USD\"`. Drives both the visual prefix and the screen-reader-only currency name. Unrecognized codes degrade the visual prefix to the code itself rather than blanking the field; the screen-reader-only currency name instead falls back to a generic \"Unknown currency.\" */\n currency?: string\n /** How to render the visual prefix. Defaults to `\"narrowSymbol\"`. Passed straight to `Intl.NumberFormat`. */\n currencyDisplay?: CurrencyInputDisplay\n /** Helper text below the input. Styled as an error when `invalid`. */\n description?: React.ReactNode\n /** If true, sets `data-flex-expand` so the field grows/shrinks to fill a `Flex` row. */\n expand?: boolean\n /** Triggers invalid state (error border, error description, aria-invalid). */\n invalid?: boolean\n /** BCP 47 locale used to derive the prefix and the screen-reader currency name. Defaults to the
|
|
1
|
+
{"version":3,"file":"CurrencyInput.js","sources":["../../../src/components/currency-input/CurrencyInput.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { Field } from \"@components/field\"\nimport { useTapestryLocale } from \"@utilities/locale\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { forwardRef, type InputHTMLAttributes } from \"react\"\n\nexport type CurrencyInputSize = \"lg\" | \"md\"\n\nexport type CurrencyInputDisplay = \"code\" | \"narrowSymbol\" | \"symbol\"\n\nfunction symbolFor(\n currency: string,\n currencyDisplay: CurrencyInputDisplay,\n locale?: string\n): string {\n try {\n return (\n new Intl.NumberFormat(locale, {\n currency,\n currencyDisplay,\n style: \"currency\",\n })\n .formatToParts(0)\n .find((part) => part.type === \"currency\")?.value ?? currency\n )\n } catch {\n return currency\n }\n}\n\nconst UNKNOWN_CURRENCY_NAME = \"Unknown currency.\"\n\nfunction currencyNameFor(currency: string, locale?: string): string {\n if (!Intl.supportedValuesOf(\"currency\").includes(currency.toUpperCase())) {\n return UNKNOWN_CURRENCY_NAME\n }\n\n try {\n const name = new Intl.DisplayNames(locale, { type: \"currency\" }).of(\n currency\n )\n return name ? `${name}.` : UNKNOWN_CURRENCY_NAME\n } catch {\n return UNKNOWN_CURRENCY_NAME\n }\n}\n\ninterface CurrencyInputBaseProps {\n /** ISO 4217 currency code (e.g. `\"USD\"`, `\"CAD\"`, `\"EUR\"`). Defaults to `\"USD\"`. Drives both the visual prefix and the screen-reader-only currency name. Unrecognized codes degrade the visual prefix to the code itself rather than blanking the field; the screen-reader-only currency name instead falls back to a generic \"Unknown currency.\" */\n currency?: string\n /** How to render the visual prefix. Defaults to `\"narrowSymbol\"`. Passed straight to `Intl.NumberFormat`. */\n currencyDisplay?: CurrencyInputDisplay\n /** Helper text below the input. Styled as an error when `invalid`. */\n description?: React.ReactNode\n /** If true, sets `data-flex-expand` so the field grows/shrinks to fill a `Flex` row. */\n expand?: boolean\n /** Triggers invalid state (error border, error description, aria-invalid). */\n invalid?: boolean\n /** BCP 47 locale used to derive the prefix and the screen-reader currency name. Defaults to the Tapestry locale (the nearest `I18nProvider`, then `setLocale`, then the browser locale). Only visibly changes anything under `currencyDisplay=\"symbol\"` — under the default `narrowSymbol` a bad locale silently falls back rather than throwing. */\n locale?: string\n /** Visual size — cascades to the prefix and input via Field's font-size custom property. Defaults to 'md'. */\n size?: CurrencyInputSize\n}\n\ninterface CurrencyInputWithLabel extends CurrencyInputBaseProps {\n \"aria-labelledby\"?: never\n /** If true, the label is visually hidden but remains in the DOM/AT tree. */\n hideLabel?: boolean\n /** The visible label. */\n label: React.ReactNode\n}\n\ninterface CurrencyInputWithAriaLabelledBy extends CurrencyInputBaseProps {\n \"aria-labelledby\": string\n hideLabel?: never\n label?: never\n}\n\nexport type CurrencyInputProps =\n | CurrencyInputWithAriaLabelledBy\n | CurrencyInputWithLabel\n\n/**\n * Combines standard HTML input attributes with CurrencyInput's own props.\n * `type` and `inputMode` are fixed and not exposed; `size` is redefined above.\n */\nexport type CurrencyInputElementProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n keyof CurrencyInputProps | \"inputMode\" | \"size\" | \"type\"\n> &\n CurrencyInputProps\n\n/**\n * A currency-prefixed text input — a plain `<input>` with a leading currency\n * symbol (`$`, `€`, `CA$`, …) derived from an ISO 4217 currency code. It is\n * presentational only: no masking, parsing, or rounding. Value in, value\n * out — callers keep whatever number handling they already have. Composes\n * `Field` directly for label, description, and state layout.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-currencyinput--docs | Storybook Documentation}\n */\nexport const CurrencyInput = forwardRef<\n HTMLInputElement,\n CurrencyInputElementProps\n>(function CurrencyInput(\n {\n \"aria-labelledby\": ariaLabelledBy,\n className,\n currency = \"USD\",\n currencyDisplay = \"narrowSymbol\",\n description,\n expand,\n hideLabel,\n id,\n invalid,\n label,\n locale: localeProp,\n size = \"md\",\n ...restProps\n }: CurrencyInputElementProps,\n ref\n) {\n const tapestryLocale = useTapestryLocale()\n const locale = localeProp ?? tapestryLocale\n const stableId = useId()\n const inputId = id || `tds-currency-input-${stableId}`\n const descriptionId = description ? `${inputId}-description` : undefined\n const currencyNameId = `${inputId}-currency-name`\n const describedBy = [currencyNameId, descriptionId].filter(Boolean).join(\" \")\n\n const symbol = symbolFor(currency, currencyDisplay, locale)\n const currencyName = currencyNameFor(currency, locale)\n\n const fieldClassName = classNames(\n { \"tds-field--lg\": size === \"lg\" },\n className\n )\n\n const fieldLabelProps = ariaLabelledBy\n ? { \"aria-labelledby\": ariaLabelledBy }\n : { hideLabel, label }\n\n return (\n <Field\n {...fieldLabelProps}\n className={fieldClassName}\n description={description}\n expand={expand}\n id={inputId}\n >\n <div className=\"tds-currency-input-control\">\n <div aria-hidden=\"true\" className=\"tds-currency-input-prefix\">\n {symbol}\n </div>\n <input\n {...restProps}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n aria-labelledby={ariaLabelledBy}\n id={inputId}\n inputMode=\"decimal\"\n ref={ref}\n type=\"text\"\n />\n </div>\n <div\n className=\"tds-currency-input-currency-name--hidden\"\n id={currencyNameId}\n >\n {currencyName}\n </div>\n </Field>\n )\n})\n\nCurrencyInput.displayName = \"CurrencyInput\"\n"],"names":["React"],"mappings":";;;;;;AAYA,SAAS,SAAS,CAChB,QAAgB,EAChB,eAAqC,EACrC,MAAe,EAAA;AAEf,IAAA,IAAI;AACF,QAAA,QACE,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YAC5B,QAAQ;YACR,eAAe;AACf,YAAA,KAAK,EAAE,UAAU;SAClB;aACE,aAAa,CAAC,CAAC;AACf,aAAA,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,EAAE,KAAK,IAAI,QAAQ;IAElE;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,QAAQ;IACjB;AACF;AAEA,MAAM,qBAAqB,GAAG,mBAAmB;AAEjD,SAAS,eAAe,CAAC,QAAgB,EAAE,MAAe,EAAA;AACxD,IAAA,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,EAAE;AACxE,QAAA,OAAO,qBAAqB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,MAAM,cAAc,GAAG,UAAU,CAC/B,EAAE,eAAe,EAAE,IAAI,KAAK,IAAI,EAAE,EAClC,SAAS,CACV;IAED,MAAM,eAAe,GAAG;AACtB,UAAE,EAAE,iBAAiB,EAAE,cAAc;AACrC,UAAE,EAAE,SAAS,EAAE,KAAK,EAAE;IAExB,QACEA,6BAAC,KAAK,EAAA,EAAA,GACA,eAAe,EACnB,SAAS,EAAE,cAAc,EACzB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,OAAO,EAAA;QAEXA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,4BAA4B,EAAA;AACzC,YAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAiB,MAAM,EAAC,SAAS,EAAC,2BAA2B,EAAA,EAC1D,MAAM,CACH;YACNA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,GACM,SAAS,EAAA,kBAAA,EACK,WAAW,EAAA,cAAA,EACf,OAAO,IAAI,SAAS,EAAA,iBAAA,EACjB,cAAc,EAC/B,EAAE,EAAE,OAAO,EACX,SAAS,EAAC,SAAS,EACnB,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,MAAM,EAAA,CACX,CACE;AACN,QAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAC,0CAA0C,EACpD,EAAE,EAAE,cAAc,EAAA,EAEjB,YAAY,CACT,CACA;AAEZ,CAAC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
|
|
@@ -75,7 +75,7 @@ export type DatePickerElementProps = CombineAriaPropsWithCustomProps<AriaDatePic
|
|
|
75
75
|
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-datepicker--docs | Storybook Documentation}
|
|
76
76
|
* @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}
|
|
77
77
|
*/
|
|
78
|
-
export declare function DatePicker({ className, defaultValue, description, disabled, firstDayOfWeek, formatDateOnBlur, hideLabel, invalid, isDateUnavailable, label, max, min, name, onBlur, onChange, onFocus, readOnly, required, size, value, alwaysShowFourDigitYear, ...restProps }: DatePickerElementProps): React.JSX.Element;
|
|
78
|
+
export declare function DatePicker({ className, defaultValue, description, disabled, firstDayOfWeek, formatDateOnBlur, hideLabel, invalid, isDateUnavailable, label, max, min, name, onBlur, onChange, onFocus, onOpenChange, readOnly, required, size, value, alwaysShowFourDigitYear, ...restProps }: DatePickerElementProps): React.JSX.Element;
|
|
79
79
|
export declare namespace DatePicker {
|
|
80
80
|
var displayName: string;
|
|
81
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,aAAa,CAAA;AAEpB,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,aAAa,CAAA;AAEpB,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,yBAAyB,CAAA;AAGhC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAA;AAGhF,OAAO,KAAK,EAAE,EACZ,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AAGd,OAAO,EAUL,KAAK,eAAe,IAAI,mBAAmB,EAM5C,MAAM,kCAAkC,CAAA;AAQzC,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAA;AAExC,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAA;AAepD,MAAM,WAAW,eAAe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