@planningcenter/tapestry 4.10.0-rc.9 → 4.10.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/ActiveFilterInstance.d.ts +6 -4
- package/dist/components/DataTable/ActiveFilterInstance.d.ts.map +1 -1
- package/dist/components/DataTable/ActiveFilterInstance.js +8 -2
- package/dist/components/DataTable/ActiveFilterInstance.js.map +1 -1
- package/dist/components/DataTable/ActiveFilters.d.ts.map +1 -1
- package/dist/components/DataTable/ActiveFilters.js +3 -1
- package/dist/components/DataTable/ActiveFilters.js.map +1 -1
- package/dist/components/DataTable/CollectionEditorsLazy.d.ts.map +1 -1
- package/dist/components/DataTable/CollectionEditorsLazy.js +7 -5
- package/dist/components/DataTable/CollectionEditorsLazy.js.map +1 -1
- package/dist/components/DataTable/CollectionEditorsShared.d.ts.map +1 -1
- package/dist/components/DataTable/CollectionEditorsShared.js +1 -5
- package/dist/components/DataTable/CollectionEditorsShared.js.map +1 -1
- package/dist/components/DataTable/CollectionEditorsStatic.d.ts +1 -1
- package/dist/components/DataTable/CollectionEditorsStatic.d.ts.map +1 -1
- package/dist/components/DataTable/CollectionEditorsStatic.js +8 -17
- package/dist/components/DataTable/CollectionEditorsStatic.js.map +1 -1
- package/dist/components/DataTable/DataTable.js +14 -11
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/DataTable/FilterChip.d.ts +4 -3
- package/dist/components/DataTable/FilterChip.d.ts.map +1 -1
- package/dist/components/DataTable/FilterChip.js +24 -3
- package/dist/components/DataTable/FilterChip.js.map +1 -1
- package/dist/components/DataTable/FilterControls.d.ts.map +1 -1
- package/dist/components/DataTable/FilterControls.js +1 -1
- package/dist/components/DataTable/FilterControls.js.map +1 -1
- package/dist/components/DataTable/FilterTypes.d.ts +32 -8
- package/dist/components/DataTable/FilterTypes.d.ts.map +1 -1
- package/dist/components/DataTable/FocusFirstControl.d.ts +11 -0
- package/dist/components/DataTable/FocusFirstControl.d.ts.map +1 -0
- package/dist/components/DataTable/FocusFirstControl.js +31 -0
- package/dist/components/DataTable/FocusFirstControl.js.map +1 -0
- package/dist/components/DataTable/TableSearch.d.ts.map +1 -1
- package/dist/components/DataTable/TableSearch.js +1 -1
- package/dist/components/DataTable/TableSearch.js.map +1 -1
- package/dist/components/DataTable/collectionFilter.d.ts +14 -8
- package/dist/components/DataTable/collectionFilter.d.ts.map +1 -1
- package/dist/components/DataTable/collectionFilter.js +9 -5
- package/dist/components/DataTable/collectionFilter.js.map +1 -1
- package/dist/components/DataTable/dateFilter.d.ts +7 -3
- package/dist/components/DataTable/dateFilter.d.ts.map +1 -1
- package/dist/components/DataTable/dateFilter.js +9 -14
- package/dist/components/DataTable/dateFilter.js.map +1 -1
- package/dist/components/DataTable/dayFilter.d.ts +4 -3
- package/dist/components/DataTable/dayFilter.d.ts.map +1 -1
- package/dist/components/DataTable/dayFilter.js +11 -12
- package/dist/components/DataTable/dayFilter.js.map +1 -1
- package/dist/components/DataTable/filterKeys.d.ts +1 -1
- package/dist/components/DataTable/filterKeys.d.ts.map +1 -1
- package/dist/components/DataTable/index.d.ts +8 -3
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DataTable/numberFilter.d.ts +16 -3
- package/dist/components/DataTable/numberFilter.d.ts.map +1 -1
- package/dist/components/DataTable/numberFilter.js +41 -13
- package/dist/components/DataTable/numberFilter.js.map +1 -1
- package/dist/components/DataTable/presenceFilter.d.ts +4 -1
- package/dist/components/DataTable/presenceFilter.d.ts.map +1 -1
- package/dist/components/DataTable/presenceFilter.js +3 -3
- package/dist/components/DataTable/presenceFilter.js.map +1 -1
- package/dist/components/DataTable/scopedFilter.d.ts +2 -0
- package/dist/components/DataTable/scopedFilter.d.ts.map +1 -1
- package/dist/components/DataTable/scopedFilter.js +6 -3
- package/dist/components/DataTable/scopedFilter.js.map +1 -1
- package/dist/components/DataTable/textFilter.d.ts +3 -1
- package/dist/components/DataTable/textFilter.d.ts.map +1 -1
- package/dist/components/DataTable/textFilter.js +5 -9
- package/dist/components/DataTable/textFilter.js.map +1 -1
- package/dist/components/DataTable/useSearchFilter.d.ts +1 -1
- package/dist/components/DataTable/utils.d.ts +1 -0
- package/dist/components/DataTable/utils.d.ts.map +1 -1
- package/dist/components/DataTable/utils.js +1 -1
- package/dist/components/DataTable/utils.js.map +1 -1
- package/dist/components/segmented-control/IconSegment.d.ts +6 -1
- package/dist/components/segmented-control/IconSegment.d.ts.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/segmented-control/Segment.d.ts +6 -1
- package/dist/components/segmented-control/Segment.d.ts.map +1 -1
- package/dist/components/segmented-control/Segment.js +1 -1
- package/dist/components/segmented-control/Segment.js.map +1 -1
- package/dist/components/segmented-control/SegmentBase.d.ts +1 -5
- package/dist/components/segmented-control/SegmentBase.d.ts.map +1 -1
- package/dist/components/segmented-control/SegmentBase.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControl.d.ts +3 -9
- package/dist/components/segmented-control/SegmentedControl.d.ts.map +1 -1
- package/dist/components/segmented-control/SegmentedControl.js +3 -9
- package/dist/components/segmented-control/SegmentedControl.js.map +1 -1
- package/dist/components/segmented-control/index.d.ts +1 -0
- package/dist/components/segmented-control/index.d.ts.map +1 -1
- package/dist/index.css +155 -0
- 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 +3 -0
- package/dist/index.js.map +1 -1
- package/dist/reactRender.css +1537 -1395
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +1537 -1395
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/unstable.css +171 -29
- 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 +3 -3
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconSegment.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/IconSegment.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,EAAE,KAAK,oBAAoB,EAAc,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"IconSegment.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/IconSegment.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,EAAE,KAAK,oBAAoB,EAAc,MAAM,OAAO,CAAA;AAEpE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAA;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAA;IACpB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2BAA2B;IAC3B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,oBAAoB,CAAC,iBAAiB,CAAC,EACrC,MAAM,gBAAgB,GACtB,cAAc,GACd,UAAU,GACV,SAAS,GACT,WAAW,GACX,MAAM,GACN,UAAU,GACV,MAAM,CACT,GACC,gBAAgB,CAAA;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,iQAKtB,CAAA"}
|
|
@@ -7,7 +7,7 @@ import { SegmentBase } from './SegmentBase.js';
|
|
|
7
7
|
* selection state, group `disabled`, and roving tabindex from that context.
|
|
8
8
|
*
|
|
9
9
|
* @component
|
|
10
|
-
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/
|
|
10
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-segmentedcontrol--docs | Storybook Documentation}
|
|
11
11
|
*/
|
|
12
12
|
const IconSegment = forwardRef(function IconSegment({ icon, ...restProps }, ref) {
|
|
13
13
|
return React__default.createElement(SegmentBase, { ...restProps, content: icon, iconOnly: true, ref: ref });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconSegment.js","sources":["../../../src/components/segmented-control/IconSegment.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport React, { type ButtonHTMLAttributes, forwardRef } from \"react\"\n\nimport { SegmentBase } from \"./SegmentBase\"\n\nexport interface IconSegmentProps {\n /** Accessible label — required since there's no visible text. */\n \"aria-label\": string\n /** Disables this item only. */\n disabled?: boolean\n /** The icon to display. */\n icon: React.ReactNode\n /** Unique identifier for this item. */\n value: string\n}\n\nexport type IconSegmentElementProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n | keyof IconSegmentProps\n | \"aria-checked\"\n | \"children\"\n | \"onClick\"\n | \"onKeyDown\"\n | \"role\"\n | \"tabIndex\"\n | \"type\"\n> &\n IconSegmentProps\n\n/**\n * An icon-only item within a `SegmentedControl`, mirroring `IconButton`'s\n * shape. Must be rendered as a direct child of `SegmentedControl` — it reads\n * selection state, group `disabled`, and roving tabindex from that context.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/
|
|
1
|
+
{"version":3,"file":"IconSegment.js","sources":["../../../src/components/segmented-control/IconSegment.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport React, { type ButtonHTMLAttributes, forwardRef } from \"react\"\n\nimport { SegmentBase, type SegmentKind } from \"./SegmentBase\"\n\nexport interface IconSegmentProps {\n /** Accessible label — required since there's no visible text. */\n \"aria-label\": string\n /** Disables this item only. */\n disabled?: boolean\n /** The icon to display. */\n icon: React.ReactNode\n /**\n * This segment's color when selected. Default `'interaction-subtle'`.\n */\n kind?: SegmentKind\n /** Unique identifier for this item. */\n value: string\n}\n\nexport type IconSegmentElementProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n | keyof IconSegmentProps\n | \"aria-checked\"\n | \"children\"\n | \"onClick\"\n | \"onKeyDown\"\n | \"role\"\n | \"tabIndex\"\n | \"type\"\n> &\n IconSegmentProps\n\n/**\n * An icon-only item within a `SegmentedControl`, mirroring `IconButton`'s\n * shape. Must be rendered as a direct child of `SegmentedControl` — it reads\n * selection state, group `disabled`, and roving tabindex from that context.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-segmentedcontrol--docs | Storybook Documentation}\n */\nexport const IconSegment = forwardRef<\n HTMLButtonElement,\n IconSegmentElementProps\n>(function IconSegment({ icon, ...restProps }: IconSegmentElementProps, ref) {\n return <SegmentBase {...restProps} content={icon} iconOnly ref={ref} />\n})\n\nIconSegment.displayName = \"IconSegment\"\n"],"names":["React"],"mappings":";;;AAkCA;;;;;;;AAOG;AACI,MAAM,WAAW,GAAG,UAAU,CAGnC,SAAS,WAAW,CAAC,EAAE,IAAI,EAAE,GAAG,SAAS,EAA2B,EAAE,GAAG,EAAA;AACzE,IAAA,OAAOA,cAAA,CAAA,aAAA,CAAC,WAAW,EAAA,EAAA,GAAK,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAA,IAAA,EAAC,GAAG,EAAE,GAAG,GAAI;AACzE,CAAC;AAED,WAAW,CAAC,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
2
|
import React, { type ButtonHTMLAttributes } from "react";
|
|
3
|
+
import { type SegmentKind } from "./SegmentBase";
|
|
3
4
|
export interface SegmentProps {
|
|
4
5
|
/** Disables this item only. */
|
|
5
6
|
disabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* This segment's color when selected. Default `'interaction-subtle'`.
|
|
9
|
+
*/
|
|
10
|
+
kind?: SegmentKind;
|
|
6
11
|
/** Visible text. */
|
|
7
12
|
label: string;
|
|
8
13
|
/** Optional leading icon. */
|
|
@@ -22,7 +27,7 @@ export type SegmentElementProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>,
|
|
|
22
27
|
* and roving tabindex from that context.
|
|
23
28
|
*
|
|
24
29
|
* @component
|
|
25
|
-
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/
|
|
30
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-segmentedcontrol--docs | Storybook Documentation}
|
|
26
31
|
*/
|
|
27
32
|
export declare const Segment: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children" | "tabIndex" | "role" | "aria-checked" | "onKeyDown" | "onClick" | "type" | keyof SegmentProps> & SegmentProps & React.RefAttributes<HTMLButtonElement>>;
|
|
28
33
|
//# sourceMappingURL=Segment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Segment.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/Segment.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAGpB,OAAO,KAAK,EAAE,EAAE,KAAK,oBAAoB,EAAc,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Segment.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/Segment.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAGpB,OAAO,KAAK,EAAE,EAAE,KAAK,oBAAoB,EAAc,MAAM,OAAO,CAAA;AAEpE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAA;AAE7D,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,6BAA6B;IAC7B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,oBAAoB,CAAC,iBAAiB,CAAC,EACrC,MAAM,YAAY,GAClB,cAAc,GACd,UAAU,GACV,SAAS,GACT,WAAW,GACX,MAAM,GACN,UAAU,GACV,MAAM,CACT,GACC,YAAY,CAAA;AAEd;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,yPAmBnB,CAAA"}
|
|
@@ -8,7 +8,7 @@ import { SegmentBase } from './SegmentBase.js';
|
|
|
8
8
|
* and roving tabindex from that context.
|
|
9
9
|
*
|
|
10
10
|
* @component
|
|
11
|
-
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/
|
|
11
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-segmentedcontrol--docs | Storybook Documentation}
|
|
12
12
|
*/
|
|
13
13
|
const Segment = forwardRef(function Segment({ label, prefix, suffix, ...restProps }, ref) {
|
|
14
14
|
return (React__default.createElement(SegmentBase, { ...restProps, content: React__default.createElement(React__default.Fragment, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Segment.js","sources":["../../../src/components/segmented-control/Segment.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { wrapStringWithSpan } from \"@utilities/buttonLinkShared\"\nimport React, { type ButtonHTMLAttributes, forwardRef } from \"react\"\n\nimport { SegmentBase } from \"./SegmentBase\"\n\nexport interface SegmentProps {\n /** Disables this item only. */\n disabled?: boolean\n /** Visible text. */\n label: string\n /** Optional leading icon. */\n prefix?: React.ReactNode\n /** Optional trailing icon. */\n suffix?: React.ReactNode\n /**\n * Unique identifier for this item — distinct from `label`, so relabeling\n * doesn't change the selected identity.\n */\n value: string\n}\n\nexport type SegmentElementProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n | keyof SegmentProps\n | \"aria-checked\"\n | \"children\"\n | \"onClick\"\n | \"onKeyDown\"\n | \"role\"\n | \"tabIndex\"\n | \"type\"\n> &\n SegmentProps\n\n/**\n * A single item within a `SegmentedControl`. Must be rendered as a direct\n * child of `SegmentedControl` — it reads selection state, group `disabled`,\n * and roving tabindex from that context.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/
|
|
1
|
+
{"version":3,"file":"Segment.js","sources":["../../../src/components/segmented-control/Segment.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { wrapStringWithSpan } from \"@utilities/buttonLinkShared\"\nimport React, { type ButtonHTMLAttributes, forwardRef } from \"react\"\n\nimport { SegmentBase, type SegmentKind } from \"./SegmentBase\"\n\nexport interface SegmentProps {\n /** Disables this item only. */\n disabled?: boolean\n /**\n * This segment's color when selected. Default `'interaction-subtle'`.\n */\n kind?: SegmentKind\n /** Visible text. */\n label: string\n /** Optional leading icon. */\n prefix?: React.ReactNode\n /** Optional trailing icon. */\n suffix?: React.ReactNode\n /**\n * Unique identifier for this item — distinct from `label`, so relabeling\n * doesn't change the selected identity.\n */\n value: string\n}\n\nexport type SegmentElementProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n | keyof SegmentProps\n | \"aria-checked\"\n | \"children\"\n | \"onClick\"\n | \"onKeyDown\"\n | \"role\"\n | \"tabIndex\"\n | \"type\"\n> &\n SegmentProps\n\n/**\n * A single item within a `SegmentedControl`. Must be rendered as a direct\n * child of `SegmentedControl` — it reads selection state, group `disabled`,\n * and roving tabindex from that context.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-segmentedcontrol--docs | Storybook Documentation}\n */\nexport const Segment = forwardRef<HTMLButtonElement, SegmentElementProps>(\n function Segment(\n { label, prefix, suffix, ...restProps }: SegmentElementProps,\n ref\n ) {\n return (\n <SegmentBase\n {...restProps}\n content={\n <>\n {wrapStringWithSpan(prefix)}\n {label}\n {wrapStringWithSpan(suffix)}\n </>\n }\n ref={ref}\n />\n )\n }\n)\n\nSegment.displayName = \"Segment\"\n"],"names":["React"],"mappings":";;;;AAwCA;;;;;;;AAOG;MACU,OAAO,GAAG,UAAU,CAC/B,SAAS,OAAO,CACd,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAuB,EAC5D,GAAG,EAAA;AAEH,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,WAAW,OACN,SAAS,EACb,OAAO,EACLA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA;YACG,kBAAkB,CAAC,MAAM,CAAC;YAC1B,KAAK;YACL,kBAAkB,CAAC,MAAM,CAAC,CAC1B,EAEL,GAAG,EAAE,GAAG,EAAA,CACR;AAEN,CAAC;AAGH,OAAO,CAAC,WAAW,GAAG,SAAS;;;;"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import React, { type ButtonHTMLAttributes } from "react";
|
|
2
|
-
export type SegmentKind = "interaction-subtle";
|
|
2
|
+
export type SegmentKind = "error" | "interaction-bold" | "interaction-subtle" | "neutral-subtle" | "success" | "warning";
|
|
3
3
|
export interface SegmentBaseProps {
|
|
4
4
|
content: React.ReactNode;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
iconOnly?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Not yet exposed on `Segment`/`IconSegment` —
|
|
9
|
-
* V1 only has one value ("interaction-subtle").
|
|
10
|
-
*/
|
|
11
7
|
kind?: SegmentKind;
|
|
12
8
|
value: string;
|
|
13
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentBase.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/SegmentBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,KAAK,oBAAoB,EAA0B,MAAM,OAAO,CAAA;AAIhF,MAAM,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"SegmentBase.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/SegmentBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,KAAK,oBAAoB,EAA0B,MAAM,OAAO,CAAA;AAIhF,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,kBAAkB,GAClB,oBAAoB,GACpB,gBAAgB,GAChB,SAAS,GACT,SAAS,CAAA;AAWb,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,oBAAoB,CAAC,iBAAiB,CAAC,EACrC,MAAM,gBAAgB,GACtB,cAAc,GACd,UAAU,GACV,SAAS,GACT,WAAW,GACX,MAAM,GACN,UAAU,GACV,MAAM,CACT,GACC,gBAAgB,CAAA;AAElB;;;;;GAKG;AACH,eAAO,MAAM,WAAW,iQAuFtB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentBase.js","sources":["../../../src/components/segmented-control/SegmentBase.tsx"],"sourcesContent":["import classNames from \"classnames\"\nimport React, { type ButtonHTMLAttributes, forwardRef, useContext } from \"react\"\n\nimport { SegmentedControlContext } from \"./SegmentedControlContext\"\n\nexport type SegmentKind
|
|
1
|
+
{"version":3,"file":"SegmentBase.js","sources":["../../../src/components/segmented-control/SegmentBase.tsx"],"sourcesContent":["import classNames from \"classnames\"\nimport React, { type ButtonHTMLAttributes, forwardRef, useContext } from \"react\"\n\nimport { SegmentedControlContext } from \"./SegmentedControlContext\"\n\nexport type SegmentKind =\n | \"error\"\n | \"interaction-bold\"\n | \"interaction-subtle\"\n | \"neutral-subtle\"\n | \"success\"\n | \"warning\"\n\nconst ARROW_KEYS = [\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n]\n\nexport interface SegmentBaseProps {\n content: React.ReactNode\n disabled?: boolean\n iconOnly?: boolean\n kind?: SegmentKind\n value: string\n}\n\nexport type SegmentBaseElementProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n | keyof SegmentBaseProps\n | \"aria-checked\"\n | \"children\"\n | \"onClick\"\n | \"onKeyDown\"\n | \"role\"\n | \"tabIndex\"\n | \"type\"\n> &\n SegmentBaseProps\n\n/**\n * Shared `role=\"radio\"` button implementation for `Segment` and\n * `IconSegment` — selection state, roving tabindex, arrow-key navigation,\n * and disabled propagation all live here so the two public components only\n * differ in what they render inside the button.\n */\nexport const SegmentBase = forwardRef<\n HTMLButtonElement,\n SegmentBaseElementProps\n>(function SegmentBase(\n {\n className,\n content,\n disabled = false,\n iconOnly = false,\n kind = \"interaction-subtle\",\n value,\n ...restProps\n }: SegmentBaseElementProps,\n ref\n) {\n const context = useContext(SegmentedControlContext)\n const isDisabled = disabled || (context?.disabled ?? false)\n const isChecked = context?.value === value\n\n const combinedClassName = classNames(\n \"tds-segmented-control-segment\",\n iconOnly && \"tds-segmented-control-segment--icon-only\",\n `tds-segmented-control-segment--${kind}`,\n className\n )\n\n const handleClick = () => {\n if (isDisabled) return\n context?.onSelect(value)\n }\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (!ARROW_KEYS.includes(event.key)) return\n\n const track = event.currentTarget.closest('[role=\"radiogroup\"]')\n if (!track) return\n\n const segments = Array.from(\n track.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]:not(:disabled)')\n )\n const currentIndex = segments.indexOf(event.currentTarget)\n if (currentIndex === -1) return\n\n let nextIndex = currentIndex\n switch (event.key) {\n case \"ArrowLeft\":\n case \"ArrowUp\":\n nextIndex = currentIndex === 0 ? segments.length - 1 : currentIndex - 1\n break\n case \"ArrowRight\":\n case \"ArrowDown\":\n nextIndex = currentIndex === segments.length - 1 ? 0 : currentIndex + 1\n break\n case \"Home\":\n nextIndex = 0\n break\n case \"End\":\n nextIndex = segments.length - 1\n break\n }\n\n const nextSegment = segments[nextIndex]\n if (!nextSegment || nextSegment === event.currentTarget) return\n\n event.preventDefault()\n nextSegment.focus()\n const nextValue = nextSegment.dataset.segmentValue\n if (nextValue) context?.onSelect(nextValue)\n }\n\n return (\n <button\n {...restProps}\n aria-checked={isChecked ? \"true\" : \"false\"}\n className={combinedClassName}\n data-segment-value={value}\n disabled={isDisabled}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n ref={ref}\n role=\"radio\"\n tabIndex={value === context?.tabbableValue ? 0 : -1}\n type=\"button\"\n >\n {content}\n </button>\n )\n})\n\nSegmentBase.displayName = \"SegmentBase\"\n"],"names":["React"],"mappings":"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"}
|
|
@@ -44,17 +44,11 @@ export type SegmentedControlProps = SegmentedControlControlledProps | SegmentedC
|
|
|
44
44
|
export type SegmentedControlElementProps = Omit<HTMLAttributes<HTMLDivElement>, keyof SegmentedControlProps | "children" | "role"> & SegmentedControlProps;
|
|
45
45
|
/**
|
|
46
46
|
* A single-select group of items — Table/Card, Yes/No, Tag/Tag group —
|
|
47
|
-
* where exactly one `Segment`/`IconSegment` is selected at a time.
|
|
48
|
-
* the
|
|
49
|
-
* `role="radio"` + `aria-checked` items, one roving tab stop, arrow keys move
|
|
50
|
-
* both focus and selection.
|
|
51
|
-
*
|
|
52
|
-
* Not a binary on/off choice (`ToggleSwitch` is the right component there),
|
|
53
|
-
* and not a form control — `SegmentedControl`'s state is read from and
|
|
54
|
-
* written to independently of any surrounding form.
|
|
47
|
+
* where exactly one `Segment`/`IconSegment` is selected at a time. Arrow keys
|
|
48
|
+
* move the selection, and the group is one tab stop.
|
|
55
49
|
*
|
|
56
50
|
* @component
|
|
57
|
-
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/
|
|
51
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-segmentedcontrol--docs | Storybook Documentation}
|
|
58
52
|
*/
|
|
59
53
|
export declare const SegmentedControl: {
|
|
60
54
|
({ children, className, defaultValue, disabled, fullWidth, hideLabel, id, label, onChange, size, value, ...restProps }: SegmentedControlElementProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAIpB,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAY,MAAM,OAAO,CAAA;AAI5D,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,CAAA;AAE9C,UAAU,2BAA2B;IACnC,wCAAwC;IACxC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,sBAAsB;IACtB,IAAI,CAAC,EAAE,oBAAoB,CAAA;CAC5B;AAED,UAAU,+BAAgC,SAAQ,2BAA2B;IAC3E,YAAY,CAAC,EAAE,KAAK,CAAA;IACpB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAA;CACd;AAED,UAAU,iCACR,SAAQ,2BAA2B;IACnC;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,MAAM,MAAM,qBAAqB,GAC7B,+BAA+B,GAC/B,iCAAiC,CAAA;AAErC,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,cAAc,CAAC,cAAc,CAAC,EAC9B,MAAM,qBAAqB,GAAG,UAAU,GAAG,MAAM,CAClD,GACC,qBAAqB,CAAA;AAEvB
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAIpB,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAY,MAAM,OAAO,CAAA;AAI5D,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,CAAA;AAE9C,UAAU,2BAA2B;IACnC,wCAAwC;IACxC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,sBAAsB;IACtB,IAAI,CAAC,EAAE,oBAAoB,CAAA;CAC5B;AAED,UAAU,+BAAgC,SAAQ,2BAA2B;IAC3E,YAAY,CAAC,EAAE,KAAK,CAAA;IACpB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAA;CACd;AAED,UAAU,iCACR,SAAQ,2BAA2B;IACnC;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,MAAM,MAAM,qBAAqB,GAC7B,+BAA+B,GAC/B,iCAAiC,CAAA;AAErC,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,cAAc,CAAC,cAAc,CAAC,EAC9B,MAAM,qBAAqB,GAAG,UAAU,GAAG,MAAM,CAClD,GACC,qBAAqB,CAAA;AAEvB;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;4HAa1B,4BAA4B;;CAqD9B,CAAA"}
|
|
@@ -5,17 +5,11 @@ import { SegmentedControlContext } from './SegmentedControlContext.js';
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A single-select group of items — Table/Card, Yes/No, Tag/Tag group —
|
|
8
|
-
* where exactly one `Segment`/`IconSegment` is selected at a time.
|
|
9
|
-
* the
|
|
10
|
-
* `role="radio"` + `aria-checked` items, one roving tab stop, arrow keys move
|
|
11
|
-
* both focus and selection.
|
|
12
|
-
*
|
|
13
|
-
* Not a binary on/off choice (`ToggleSwitch` is the right component there),
|
|
14
|
-
* and not a form control — `SegmentedControl`'s state is read from and
|
|
15
|
-
* written to independently of any surrounding form.
|
|
8
|
+
* where exactly one `Segment`/`IconSegment` is selected at a time. Arrow keys
|
|
9
|
+
* move the selection, and the group is one tab stop.
|
|
16
10
|
*
|
|
17
11
|
* @component
|
|
18
|
-
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/
|
|
12
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-segmentedcontrol--docs | Storybook Documentation}
|
|
19
13
|
*/
|
|
20
14
|
const SegmentedControl = ({ children, className, defaultValue, disabled = false, fullWidth = false, hideLabel = false, id, label, onChange, size = "md", value, ...restProps }) => {
|
|
21
15
|
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.js","sources":["../../../src/components/segmented-control/SegmentedControl.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { type HTMLAttributes, useState } from \"react\"\n\nimport { SegmentedControlContext } from \"./SegmentedControlContext\"\n\nexport type SegmentedControlSize = \"md\" | \"sm\"\n\ninterface SegmentedControlSharedProps {\n /** `Segment`/`IconSegment` elements. */\n children: React.ReactNode\n /** Disables the whole group. */\n disabled?: boolean\n /**\n * If `true`, the group spans 100% of its container and items split the\n * width evenly. Intended for a primary mode switch at the top of a\n * section/modal/pane — not for a control nested deep in a form.\n */\n fullWidth?: boolean\n /**\n * If `true`, renders `label` visually hidden instead of a visible\n * element.\n */\n hideLabel?: boolean\n /**\n * Accessible label for the group. Rendered as a visible element by\n * default.\n */\n label: string\n /** Called with the newly selected item's `value`. */\n onChange?: (value: string) => void\n /** Default `'md'`. */\n size?: SegmentedControlSize\n}\n\ninterface SegmentedControlControlledProps extends SegmentedControlSharedProps {\n defaultValue?: never\n /** Controlled selected item's `value`. */\n value: string\n}\n\ninterface SegmentedControlUncontrolledProps\n extends SegmentedControlSharedProps {\n /**\n * Uncontrolled initial selected item's `value` — a segmented control\n * always reflects a current mode, so one item must start selected.\n */\n defaultValue: string\n value?: never\n}\n\nexport type SegmentedControlProps =\n | SegmentedControlControlledProps\n | SegmentedControlUncontrolledProps\n\nexport type SegmentedControlElementProps = Omit<\n HTMLAttributes<HTMLDivElement>,\n keyof SegmentedControlProps | \"children\" | \"role\"\n> &\n SegmentedControlProps\n\n/**\n * A single-select group of items — Table/Card, Yes/No, Tag/Tag group —\n * where exactly one `Segment`/`IconSegment` is selected at a time.
|
|
1
|
+
{"version":3,"file":"SegmentedControl.js","sources":["../../../src/components/segmented-control/SegmentedControl.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { type HTMLAttributes, useState } from \"react\"\n\nimport { SegmentedControlContext } from \"./SegmentedControlContext\"\n\nexport type SegmentedControlSize = \"md\" | \"sm\"\n\ninterface SegmentedControlSharedProps {\n /** `Segment`/`IconSegment` elements. */\n children: React.ReactNode\n /** Disables the whole group. */\n disabled?: boolean\n /**\n * If `true`, the group spans 100% of its container and items split the\n * width evenly. Intended for a primary mode switch at the top of a\n * section/modal/pane — not for a control nested deep in a form.\n */\n fullWidth?: boolean\n /**\n * If `true`, renders `label` visually hidden instead of a visible\n * element.\n */\n hideLabel?: boolean\n /**\n * Accessible label for the group. Rendered as a visible element by\n * default.\n */\n label: string\n /** Called with the newly selected item's `value`. */\n onChange?: (value: string) => void\n /** Default `'md'`. */\n size?: SegmentedControlSize\n}\n\ninterface SegmentedControlControlledProps extends SegmentedControlSharedProps {\n defaultValue?: never\n /** Controlled selected item's `value`. */\n value: string\n}\n\ninterface SegmentedControlUncontrolledProps\n extends SegmentedControlSharedProps {\n /**\n * Uncontrolled initial selected item's `value` — a segmented control\n * always reflects a current mode, so one item must start selected.\n */\n defaultValue: string\n value?: never\n}\n\nexport type SegmentedControlProps =\n | SegmentedControlControlledProps\n | SegmentedControlUncontrolledProps\n\nexport type SegmentedControlElementProps = Omit<\n HTMLAttributes<HTMLDivElement>,\n keyof SegmentedControlProps | \"children\" | \"role\"\n> &\n SegmentedControlProps\n\n/**\n * A single-select group of items — Table/Card, Yes/No, Tag/Tag group —\n * where exactly one `Segment`/`IconSegment` is selected at a time. Arrow keys\n * move the selection, and the group is one tab stop.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-segmentedcontrol--docs | Storybook Documentation}\n */\nexport const SegmentedControl = ({\n children,\n className,\n defaultValue,\n disabled = false,\n fullWidth = false,\n hideLabel = false,\n id,\n label,\n onChange,\n size = \"md\",\n value,\n ...restProps\n}: SegmentedControlElementProps) => {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue)\n const isControlled = value !== undefined\n const selectedValue = isControlled ? value : uncontrolledValue\n\n const onSelect = (nextValue: string) => {\n if (nextValue === selectedValue) return\n if (!isControlled) setUncontrolledValue(nextValue)\n onChange?.(nextValue)\n }\n\n const contextValue = {\n disabled,\n onSelect,\n tabbableValue: selectedValue,\n value: selectedValue,\n }\n\n const stableId = useId()\n const componentId = id || `tds-segmented-control-${stableId}`\n const labelId = `${componentId}-label`\n\n const combinedClassName = classNames(\n \"tds-segmented-control\",\n {\n \"tds-segmented-control--full-width\": fullWidth,\n \"tds-segmented-control--sm\": size === \"sm\",\n },\n className\n )\n\n return (\n <div {...restProps} className={combinedClassName} id={componentId}>\n <div\n className={classNames(\n \"tds-segmented-control-label\",\n hideLabel && \"tds-segmented-control-label--hidden\"\n )}\n id={labelId}\n >\n {label}\n </div>\n <div\n aria-labelledby={labelId}\n className=\"tds-segmented-control-track\"\n role=\"radiogroup\"\n >\n <SegmentedControlContext.Provider value={contextValue}>\n {children}\n </SegmentedControlContext.Provider>\n </div>\n </div>\n )\n}\n\nSegmentedControl.displayName = \"SegmentedControl\"\n"],"names":["React"],"mappings":";;;;;AA+DA;;;;;;;AAOG;AACI,MAAM,gBAAgB,GAAG,CAAC,EAC/B,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,EAAE,EACF,KAAK,EACL,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,KAAK,EACL,GAAG,SAAS,EACiB,KAAI;IACjC,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC;AACxE,IAAA,MAAM,YAAY,GAAG,KAAK,KAAK,SAAS;IACxC,MAAM,aAAa,GAAG,YAAY,GAAG,KAAK,GAAG,iBAAiB;AAE9D,IAAA,MAAM,QAAQ,GAAG,CAAC,SAAiB,KAAI;QACrC,IAAI,SAAS,KAAK,aAAa;YAAE;AACjC,QAAA,IAAI,CAAC,YAAY;YAAE,oBAAoB,CAAC,SAAS,CAAC;AAClD,QAAA,QAAQ,GAAG,SAAS,CAAC;AACvB,IAAA,CAAC;AAED,IAAA,MAAM,YAAY,GAAG;QACnB,QAAQ;QACR,QAAQ;AACR,QAAA,aAAa,EAAE,aAAa;AAC5B,QAAA,KAAK,EAAE,aAAa;KACrB;AAED,IAAA,MAAM,QAAQ,GAAG,KAAK,EAAE;AACxB,IAAA,MAAM,WAAW,GAAG,EAAE,IAAI,CAAA,sBAAA,EAAyB,QAAQ,EAAE;AAC7D,IAAA,MAAM,OAAO,GAAG,CAAA,EAAG,WAAW,QAAQ;AAEtC,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,uBAAuB,EACvB;AACE,QAAA,mCAAmC,EAAE,SAAS;QAC9C,2BAA2B,EAAE,IAAI,KAAK,IAAI;KAC3C,EACD,SAAS,CACV;IAED,QACEA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAS,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,EAAE,WAAW,EAAA;AAC/D,QAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,UAAU,CACnB,6BAA6B,EAC7B,SAAS,IAAI,qCAAqC,CACnD,EACD,EAAE,EAAE,OAAO,EAAA,EAEV,KAAK,CACF;QACNA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,iBAAA,EACmB,OAAO,EACxB,SAAS,EAAC,6BAA6B,EACvC,IAAI,EAAC,YAAY,EAAA;AAEjB,YAAAA,cAAA,CAAA,aAAA,CAAC,uBAAuB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,YAAY,EAAA,EAClD,QAAQ,CACwB,CAC/B,CACF;AAEV;AAEA,gBAAgB,CAAC,WAAW,GAAG,kBAAkB;;;;"}
|
|
@@ -3,6 +3,7 @@ export type { IconSegmentElementProps, IconSegmentProps } from "./IconSegment";
|
|
|
3
3
|
export { IconSegment } from "./IconSegment";
|
|
4
4
|
export type { SegmentElementProps, SegmentProps } from "./Segment";
|
|
5
5
|
export { Segment } from "./Segment";
|
|
6
|
+
export type { SegmentKind } from "./SegmentBase";
|
|
6
7
|
export type { SegmentedControlElementProps, SegmentedControlProps, SegmentedControlSize, } from "./SegmentedControl";
|
|
7
8
|
export { SegmentedControl } from "./SegmentedControl";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,YAAY,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,YAAY,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/index.css
CHANGED
|
@@ -5655,6 +5655,161 @@ a.tds-dropdown-item:is(:hover, :active){
|
|
|
5655
5655
|
--tds-search-input-clear-button-visibility:visible;
|
|
5656
5656
|
}
|
|
5657
5657
|
|
|
5658
|
+
.tds-segmented-control{
|
|
5659
|
+
--tds-segmented-control-font-size:var(--t-font-size-md);
|
|
5660
|
+
--tds-segmented-control-padding:var(--t-spacing-half);
|
|
5661
|
+
--tds-segmented-control-padding-inline:var(--t-spacing-1-half);
|
|
5662
|
+
--tds-segmented-control-icon-size:.66666667lh;
|
|
5663
|
+
--tds-segmented-control-border-radius:var(--t-border-radius-md);
|
|
5664
|
+
--tds-segmented-control-max-width:280px;
|
|
5665
|
+
--tds-segmented-control-min-height:var(--t-container-size-md);
|
|
5666
|
+
--tds-segmented-control-padding-inline-icon-only:calc((var(--tds-segmented-control-min-height) - var(--tds-segmented-control-icon-size)) / 2);
|
|
5667
|
+
--tds-segmented-control-track-gap:var(--tds-segmented-control-padding);
|
|
5668
|
+
--tds-segmented-control-width:fit-content;
|
|
5669
|
+
|
|
5670
|
+
display:flex;
|
|
5671
|
+
flex-direction:column;
|
|
5672
|
+
gap:var(--t-spacing-half);
|
|
5673
|
+
align-items:flex-start;
|
|
5674
|
+
width:var(--tds-segmented-control-width);
|
|
5675
|
+
}
|
|
5676
|
+
|
|
5677
|
+
.tds-segmented-control--sm{
|
|
5678
|
+
--tds-segmented-control-font-size:var(--t-font-size-sm);
|
|
5679
|
+
--tds-segmented-control-padding-inline:7px;
|
|
5680
|
+
--tds-segmented-control-min-height:var(--t-container-size-sm);
|
|
5681
|
+
}
|
|
5682
|
+
|
|
5683
|
+
.tds-segmented-control--full-width{
|
|
5684
|
+
--tds-segmented-control-width:100%;
|
|
5685
|
+
--tds-segmented-control-max-width:none;
|
|
5686
|
+
}
|
|
5687
|
+
|
|
5688
|
+
.tds-segmented-control--full-width .tds-segmented-control-segment{
|
|
5689
|
+
flex:1 1 0;
|
|
5690
|
+
}
|
|
5691
|
+
|
|
5692
|
+
.tds-segmented-control-label{
|
|
5693
|
+
font-size:var(--tds-segmented-control-font-size);
|
|
5694
|
+
font-weight:var(--t-font-weight-normal);
|
|
5695
|
+
color:var(--t-text-color-headline);
|
|
5696
|
+
}
|
|
5697
|
+
|
|
5698
|
+
.tds-segmented-control-label--hidden{
|
|
5699
|
+
position:absolute;
|
|
5700
|
+
width:1px;
|
|
5701
|
+
height:1px;
|
|
5702
|
+
overflow:hidden;
|
|
5703
|
+
white-space:nowrap;
|
|
5704
|
+
clip-path:inset(50%);
|
|
5705
|
+
}
|
|
5706
|
+
|
|
5707
|
+
.tds-segmented-control-track{
|
|
5708
|
+
display:inline-flex;
|
|
5709
|
+
gap:var(--tds-segmented-control-track-gap);
|
|
5710
|
+
width:var(--tds-segmented-control-width);
|
|
5711
|
+
padding:var(--tds-segmented-control-padding);
|
|
5712
|
+
background-color:var(--t-form-background-color);
|
|
5713
|
+
border:1px solid var(--t-border-color);
|
|
5714
|
+
border-radius:var(--tds-segmented-control-border-radius);
|
|
5715
|
+
}
|
|
5716
|
+
|
|
5717
|
+
.tds-segmented-control-segment{
|
|
5718
|
+
--tds-segmented-control-color:var(--t-text-color-status-neutral);
|
|
5719
|
+
--tds-segmented-control-background-color:transparent;
|
|
5720
|
+
|
|
5721
|
+
display:inline-flex;
|
|
5722
|
+
gap:var(--t-spacing-1);
|
|
5723
|
+
align-items:center;
|
|
5724
|
+
justify-content:center;
|
|
5725
|
+
max-width:var(--tds-segmented-control-max-width);
|
|
5726
|
+
min-height:var(--tds-segmented-control-min-height);
|
|
5727
|
+
padding-block:calc((var(--tds-segmented-control-min-height) - 1lh) / 2);
|
|
5728
|
+
padding-inline:var(--tds-segmented-control-padding-inline);
|
|
5729
|
+
font:inherit;
|
|
5730
|
+
font-size:var(--tds-segmented-control-font-size);
|
|
5731
|
+
color:var(--tds-segmented-control-color);
|
|
5732
|
+
text-align:center;
|
|
5733
|
+
cursor:pointer;
|
|
5734
|
+
-webkit-user-select:none;
|
|
5735
|
+
-moz-user-select:none;
|
|
5736
|
+
user-select:none;
|
|
5737
|
+
background-color:var(--tds-segmented-control-background-color);
|
|
5738
|
+
border:0;
|
|
5739
|
+
border-radius:var(--t-border-radius-sm);
|
|
5740
|
+
transition-timing-function:var(--t-ease-in-out);
|
|
5741
|
+
transition-duration:var(--t-duration-200);
|
|
5742
|
+
transition-property:color, background-color;
|
|
5743
|
+
}
|
|
5744
|
+
|
|
5745
|
+
.tds-segmented-control-segment.tds-segmented-control-segment--icon-only{
|
|
5746
|
+
padding-inline:var(--tds-segmented-control-padding-inline-icon-only);
|
|
5747
|
+
}
|
|
5748
|
+
|
|
5749
|
+
.tds-segmented-control-segment .symbol{
|
|
5750
|
+
display:block;
|
|
5751
|
+
flex-shrink:0;
|
|
5752
|
+
width:var(--tds-segmented-control-icon-size);
|
|
5753
|
+
height:var(--tds-segmented-control-icon-size);
|
|
5754
|
+
}
|
|
5755
|
+
|
|
5756
|
+
.tds-segmented-control-segment:focus-visible{
|
|
5757
|
+
outline:var(--t-focus-ring-outline);
|
|
5758
|
+
outline-offset:var(--t-focus-ring-offset);
|
|
5759
|
+
}
|
|
5760
|
+
|
|
5761
|
+
.tds-segmented-control-segment:hover{
|
|
5762
|
+
--tds-segmented-control-background-color:var(--t-fill-color-button-neutral-ghost-hover);
|
|
5763
|
+
}
|
|
5764
|
+
|
|
5765
|
+
.tds-segmented-control-segment[aria-checked="true"]{
|
|
5766
|
+
--tds-segmented-control-background-color:var(--tds-segmented-control-background-color-checked);
|
|
5767
|
+
--tds-segmented-control-color:var(--tds-segmented-control-color-checked);
|
|
5768
|
+
|
|
5769
|
+
cursor:default;
|
|
5770
|
+
}
|
|
5771
|
+
|
|
5772
|
+
.tds-segmented-control-segment:disabled{
|
|
5773
|
+
--tds-segmented-control-background-color:transparent;
|
|
5774
|
+
--tds-segmented-control-color:var(--t-text-color-disabled);
|
|
5775
|
+
|
|
5776
|
+
pointer-events:none;
|
|
5777
|
+
}
|
|
5778
|
+
|
|
5779
|
+
.tds-segmented-control-segment[aria-checked="true"]:disabled{
|
|
5780
|
+
--tds-segmented-control-background-color:var(--t-fill-color-button-neutral-solid-disabled);
|
|
5781
|
+
}
|
|
5782
|
+
|
|
5783
|
+
.tds-segmented-control-segment--neutral-subtle{
|
|
5784
|
+
--tds-segmented-control-color-checked:var(--t-text-color-status-neutral);
|
|
5785
|
+
--tds-segmented-control-background-color-checked:var(--t-fill-color-button-neutral-solid-hover);
|
|
5786
|
+
}
|
|
5787
|
+
|
|
5788
|
+
.tds-segmented-control-segment--interaction-subtle{
|
|
5789
|
+
--tds-segmented-control-color-checked:var(--t-text-color-interaction);
|
|
5790
|
+
--tds-segmented-control-background-color-checked:var(--t-fill-color-button-interaction-outline-active);
|
|
5791
|
+
}
|
|
5792
|
+
|
|
5793
|
+
.tds-segmented-control-segment--interaction-bold{
|
|
5794
|
+
--tds-segmented-control-color-checked:var(--t-text-color-inverted);
|
|
5795
|
+
--tds-segmented-control-background-color-checked:var(--t-fill-color-button-interaction-solid);
|
|
5796
|
+
}
|
|
5797
|
+
|
|
5798
|
+
.tds-segmented-control-segment--success{
|
|
5799
|
+
--tds-segmented-control-color-checked:var(--t-text-color-status-success);
|
|
5800
|
+
--tds-segmented-control-background-color-checked:var(--t-fill-color-status-success-ghost);
|
|
5801
|
+
}
|
|
5802
|
+
|
|
5803
|
+
.tds-segmented-control-segment--warning{
|
|
5804
|
+
--tds-segmented-control-color-checked:var(--t-text-color-status-warning);
|
|
5805
|
+
--tds-segmented-control-background-color-checked:var(--t-fill-color-status-warning-ghost);
|
|
5806
|
+
}
|
|
5807
|
+
|
|
5808
|
+
.tds-segmented-control-segment--error{
|
|
5809
|
+
--tds-segmented-control-color-checked:var(--t-text-color-status-error);
|
|
5810
|
+
--tds-segmented-control-background-color-checked:var(--t-fill-color-status-error-ghost);
|
|
5811
|
+
}
|
|
5812
|
+
|
|
5658
5813
|
.tds-select{
|
|
5659
5814
|
--tds-select-border-color:var(--t-form-border-color);
|
|
5660
5815
|
--tds-select-border-color-hover:var(--t-form-border-color-hover);
|