@techfides/ui-library-design 0.5.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/anatomies.d.ts +1586 -0
- package/dist/anatomies.js +107 -0
- package/dist/anatomies.js.map +1 -0
- package/dist/anatomy.d.ts +13 -0
- package/dist/anatomy.js +6 -0
- package/dist/anatomy.js.map +1 -0
- package/dist/cn.generated.js +217 -0
- package/dist/cn.generated.js.map +1 -0
- package/dist/cn.js +10 -166
- package/dist/cn.js.map +1 -1
- package/dist/control.d.ts +1 -2
- package/dist/control.js +1 -2
- package/dist/control.js.map +1 -1
- package/dist/index.d.ts +55 -52
- package/dist/index.js +59 -56
- package/dist/recipes/accordion.d.ts +28 -1
- package/dist/recipes/accordion.js +29 -1
- package/dist/recipes/accordion.js.map +1 -1
- package/dist/recipes/alert.d.ts +45 -1
- package/dist/recipes/alert.js +45 -1
- package/dist/recipes/alert.js.map +1 -1
- package/dist/recipes/band.d.ts +11 -1
- package/dist/recipes/band.js +7 -1
- package/dist/recipes/band.js.map +1 -1
- package/dist/recipes/bars.d.ts +60 -1
- package/dist/recipes/bars.js +59 -1
- package/dist/recipes/bars.js.map +1 -1
- package/dist/recipes/brandMark.d.ts +8 -1
- package/dist/recipes/brandMark.js +7 -1
- package/dist/recipes/brandMark.js.map +1 -1
- package/dist/recipes/button.d.ts +41 -4
- package/dist/recipes/button.js +31 -2
- package/dist/recipes/button.js.map +1 -1
- package/dist/recipes/cardHeader.d.ts +18 -1
- package/dist/recipes/cardHeader.js +19 -1
- package/dist/recipes/cardHeader.js.map +1 -1
- package/dist/recipes/checkbox.d.ts +16 -1
- package/dist/recipes/checkbox.js +16 -3
- package/dist/recipes/checkbox.js.map +1 -1
- package/dist/recipes/chip.d.ts +41 -2
- package/dist/recipes/chip.js +34 -1
- package/dist/recipes/chip.js.map +1 -1
- package/dist/recipes/codeEditor.d.ts +8 -1
- package/dist/recipes/codeEditor.js +7 -1
- package/dist/recipes/codeEditor.js.map +1 -1
- package/dist/recipes/datePicker.d.ts +62 -1
- package/dist/recipes/datePicker.js +56 -3
- package/dist/recipes/datePicker.js.map +1 -1
- package/dist/recipes/dialog.d.ts +49 -1
- package/dist/recipes/dialog.js +40 -1
- package/dist/recipes/dialog.js.map +1 -1
- package/dist/recipes/feature.d.ts +30 -1
- package/dist/recipes/feature.js +30 -2
- package/dist/recipes/feature.js.map +1 -1
- package/dist/recipes/field.js +1 -1
- package/dist/recipes/findings.d.ts +33 -1
- package/dist/recipes/findings.js +34 -1
- package/dist/recipes/findings.js.map +1 -1
- package/dist/recipes/heading.d.ts +12 -2
- package/dist/recipes/heading.js +7 -1
- package/dist/recipes/heading.js.map +1 -1
- package/dist/recipes/heartbeat.d.ts +52 -2
- package/dist/recipes/heartbeat.js +51 -4
- package/dist/recipes/heartbeat.js.map +1 -1
- package/dist/recipes/ink.d.ts +11 -0
- package/dist/recipes/ink.js +13 -0
- package/dist/recipes/ink.js.map +1 -0
- package/dist/recipes/input.d.ts +55 -1
- package/dist/recipes/input.js +52 -2
- package/dist/recipes/input.js.map +1 -1
- package/dist/recipes/listItem.d.ts +18 -1
- package/dist/recipes/listItem.js +20 -1
- package/dist/recipes/listItem.js.map +1 -1
- package/dist/recipes/listbox.d.ts +22 -2
- package/dist/recipes/listbox.js +19 -1
- package/dist/recipes/listbox.js.map +1 -1
- package/dist/recipes/marquee.d.ts +26 -2
- package/dist/recipes/marquee.js +24 -1
- package/dist/recipes/marquee.js.map +1 -1
- package/dist/recipes/menu.d.ts +33 -1
- package/dist/recipes/menu.js +29 -1
- package/dist/recipes/menu.js.map +1 -1
- package/dist/recipes/metaRow.d.ts +11 -2
- package/dist/recipes/metaRow.js +7 -1
- package/dist/recipes/metaRow.js.map +1 -1
- package/dist/recipes/meter.d.ts +36 -2
- package/dist/recipes/meter.js +34 -1
- package/dist/recipes/meter.js.map +1 -1
- package/dist/recipes/motion.d.ts +9 -1
- package/dist/recipes/nebula.js +1 -1
- package/dist/recipes/numberRange.d.ts +44 -1
- package/dist/recipes/numberRange.js +36 -1
- package/dist/recipes/numberRange.js.map +1 -1
- package/dist/recipes/paper.d.ts +55 -2
- package/dist/recipes/paper.js +47 -4
- package/dist/recipes/paper.js.map +1 -1
- package/dist/recipes/progressBar.d.ts +8 -1
- package/dist/recipes/progressBar.js +7 -1
- package/dist/recipes/progressBar.js.map +1 -1
- package/dist/recipes/queue.d.ts +33 -1
- package/dist/recipes/queue.js +35 -1
- package/dist/recipes/queue.js.map +1 -1
- package/dist/recipes/radioGroup.d.ts +18 -1
- package/dist/recipes/radioGroup.js +21 -3
- package/dist/recipes/radioGroup.js.map +1 -1
- package/dist/recipes/scopeSwitcher.d.ts +38 -1
- package/dist/recipes/scopeSwitcher.js +40 -1
- package/dist/recipes/scopeSwitcher.js.map +1 -1
- package/dist/recipes/scrollArea.d.ts +12 -3
- package/dist/recipes/scrollArea.js +7 -1
- package/dist/recipes/scrollArea.js.map +1 -1
- package/dist/recipes/searchPalette.d.ts +48 -1
- package/dist/recipes/searchPalette.js +49 -1
- package/dist/recipes/searchPalette.js.map +1 -1
- package/dist/recipes/sectionHeader.d.ts +20 -2
- package/dist/recipes/sectionHeader.js +20 -3
- package/dist/recipes/sectionHeader.js.map +1 -1
- package/dist/recipes/segmentedControl.d.ts +8 -1
- package/dist/recipes/segmentedControl.js +7 -1
- package/dist/recipes/segmentedControl.js.map +1 -1
- package/dist/recipes/select.d.ts +57 -1
- package/dist/recipes/select.js +51 -1
- package/dist/recipes/select.js.map +1 -1
- package/dist/recipes/separator.d.ts +13 -2
- package/dist/recipes/separator.js +8 -2
- package/dist/recipes/separator.js.map +1 -1
- package/dist/recipes/sidebar.d.ts +128 -2
- package/dist/recipes/sidebar.js +125 -2
- package/dist/recipes/sidebar.js.map +1 -1
- package/dist/recipes/sky.d.ts +31 -1
- package/dist/recipes/sky.js +30 -1
- package/dist/recipes/sky.js.map +1 -1
- package/dist/recipes/slider.d.ts +15 -1
- package/dist/recipes/slider.js +14 -1
- package/dist/recipes/slider.js.map +1 -1
- package/dist/recipes/stat.d.ts +71 -1
- package/dist/recipes/stat.js +73 -3
- package/dist/recipes/stat.js.map +1 -1
- package/dist/recipes/switch.d.ts +10 -1
- package/dist/recipes/switch.js +9 -3
- package/dist/recipes/switch.js.map +1 -1
- package/dist/recipes/table.d.ts +63 -3
- package/dist/recipes/table.js +56 -2
- package/dist/recipes/table.js.map +1 -1
- package/dist/recipes/tail.d.ts +40 -5
- package/dist/recipes/tail.js +37 -5
- package/dist/recipes/tail.js.map +1 -1
- package/dist/recipes/text.d.ts +16 -3
- package/dist/recipes/text.js +8 -3
- package/dist/recipes/text.js.map +1 -1
- package/dist/recipes/textarea.d.ts +46 -1
- package/dist/recipes/textarea.js +41 -1
- package/dist/recipes/textarea.js.map +1 -1
- package/dist/recipes/tile.d.ts +23 -1
- package/dist/recipes/tile.js +19 -1
- package/dist/recipes/tile.js.map +1 -1
- package/dist/recipes/tooltip.d.ts +8 -1
- package/dist/recipes/tooltip.js +7 -1
- package/dist/recipes/tooltip.js.map +1 -1
- package/dist/recipes/topBar.d.ts +43 -1
- package/dist/recipes/topBar.js +44 -1
- package/dist/recipes/topBar.js.map +1 -1
- package/dist/recipes/trail.d.ts +55 -5
- package/dist/recipes/trail.js +47 -5
- package/dist/recipes/trail.js.map +1 -1
- package/dist/recipes/userMenu.d.ts +23 -1
- package/dist/recipes/userMenu.js +24 -1
- package/dist/recipes/userMenu.js.map +1 -1
- package/package.json +3 -2
package/dist/recipes/chip.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare const chipRecipe: (props?: ({
|
|
|
12
12
|
accent?: "accent" | "success" | "warning" | "info" | "danger" | "neutral" | null | undefined;
|
|
13
13
|
removable?: boolean | null | undefined;
|
|
14
14
|
size?: "sm" | "md" | null | undefined;
|
|
15
|
-
tone?: "
|
|
15
|
+
tone?: "tint" | "outline" | "quiet" | null | undefined;
|
|
16
16
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
17
17
|
declare const chipDotRecipe: (props?: ({
|
|
18
18
|
accent?: "accent" | "success" | "warning" | "info" | "danger" | "neutral" | null | undefined;
|
|
@@ -21,6 +21,45 @@ declare const chipTextRecipe: (props?: import("class-variance-authority/types").
|
|
|
21
21
|
declare const chipLabelRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
22
22
|
declare const chipCountRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
23
23
|
declare const chipCloseRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
24
|
+
declare const chipAnatomy: {
|
|
25
|
+
readonly close: {
|
|
26
|
+
readonly part: "close";
|
|
27
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
28
|
+
readonly required: false;
|
|
29
|
+
};
|
|
30
|
+
readonly count: {
|
|
31
|
+
readonly part: "count";
|
|
32
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
33
|
+
readonly required: false;
|
|
34
|
+
};
|
|
35
|
+
readonly dot: {
|
|
36
|
+
readonly part: "dot";
|
|
37
|
+
readonly recipe: (props?: ({
|
|
38
|
+
accent?: "accent" | "success" | "warning" | "info" | "danger" | "neutral" | null | undefined;
|
|
39
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
40
|
+
readonly required: false;
|
|
41
|
+
};
|
|
42
|
+
readonly label: {
|
|
43
|
+
readonly part: "label";
|
|
44
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
45
|
+
readonly required: true;
|
|
46
|
+
};
|
|
47
|
+
readonly root: {
|
|
48
|
+
readonly part: "chip";
|
|
49
|
+
readonly recipe: (props?: ({
|
|
50
|
+
accent?: "accent" | "success" | "warning" | "info" | "danger" | "neutral" | null | undefined;
|
|
51
|
+
removable?: boolean | null | undefined;
|
|
52
|
+
size?: "sm" | "md" | null | undefined;
|
|
53
|
+
tone?: "tint" | "outline" | "quiet" | null | undefined;
|
|
54
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
55
|
+
readonly required: true;
|
|
56
|
+
};
|
|
57
|
+
readonly text: {
|
|
58
|
+
readonly part: "text";
|
|
59
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
60
|
+
readonly required: true;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
24
63
|
//#endregion
|
|
25
|
-
export { type ChipAccent, type ChipSize, type ChipTone, chipAccents, chipCloseRecipe, chipCountRecipe, chipDotRecipe, chipLabelRecipe, chipRecipe, chipSizes, chipTextRecipe, chipTones, defaultChipAccent, defaultChipSize, defaultChipTone };
|
|
64
|
+
export { type ChipAccent, type ChipSize, type ChipTone, chipAccents, chipAnatomy, chipCloseRecipe, chipCountRecipe, chipDotRecipe, chipLabelRecipe, chipRecipe, chipSizes, chipTextRecipe, chipTones, defaultChipAccent, defaultChipSize, defaultChipTone };
|
|
26
65
|
//# sourceMappingURL=chip.d.ts.map
|
package/dist/recipes/chip.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { anatomy } from "../anatomy.js";
|
|
1
2
|
import { controlPress, controlReach, hitArea } from "../parts/control.js";
|
|
2
3
|
import { cva } from "class-variance-authority";
|
|
3
4
|
//#region src/recipes/chip.ts
|
|
@@ -117,7 +118,39 @@ const chipCloseRecipe = cva([
|
|
|
117
118
|
...controlPress,
|
|
118
119
|
...CLOSE_HELD
|
|
119
120
|
]);
|
|
121
|
+
const chipAnatomy = anatomy({
|
|
122
|
+
close: {
|
|
123
|
+
part: "close",
|
|
124
|
+
recipe: chipCloseRecipe,
|
|
125
|
+
required: false
|
|
126
|
+
},
|
|
127
|
+
count: {
|
|
128
|
+
part: "count",
|
|
129
|
+
recipe: chipCountRecipe,
|
|
130
|
+
required: false
|
|
131
|
+
},
|
|
132
|
+
dot: {
|
|
133
|
+
part: "dot",
|
|
134
|
+
recipe: chipDotRecipe,
|
|
135
|
+
required: false
|
|
136
|
+
},
|
|
137
|
+
label: {
|
|
138
|
+
part: "label",
|
|
139
|
+
recipe: chipLabelRecipe,
|
|
140
|
+
required: true
|
|
141
|
+
},
|
|
142
|
+
root: {
|
|
143
|
+
part: "chip",
|
|
144
|
+
recipe: chipRecipe,
|
|
145
|
+
required: true
|
|
146
|
+
},
|
|
147
|
+
text: {
|
|
148
|
+
part: "text",
|
|
149
|
+
recipe: chipTextRecipe,
|
|
150
|
+
required: true
|
|
151
|
+
}
|
|
152
|
+
});
|
|
120
153
|
//#endregion
|
|
121
|
-
export { chipAccents, chipCloseRecipe, chipCountRecipe, chipDotRecipe, chipLabelRecipe, chipRecipe, chipSizes, chipTextRecipe, chipTones, defaultChipAccent, defaultChipSize, defaultChipTone };
|
|
154
|
+
export { chipAccents, chipAnatomy, chipCloseRecipe, chipCountRecipe, chipDotRecipe, chipLabelRecipe, chipRecipe, chipSizes, chipTextRecipe, chipTones, defaultChipAccent, defaultChipSize, defaultChipTone };
|
|
122
155
|
|
|
123
156
|
//# sourceMappingURL=chip.js.map
|
package/dist/recipes/chip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.js","names":[],"sources":["../../src/recipes/chip.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { controlPress, controlReach, hitArea } from '#parts/control'\n\ntype ChipTone = 'quiet' | 'outline' | 'tint'\n\ntype ChipSize = 'sm' | 'md'\n\ntype ChipAccent = 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'\n\nconst defaultChipTone = 'quiet' satisfies ChipTone\n\nconst defaultChipSize = 'md' satisfies ChipSize\n\nconst defaultChipAccent = 'neutral' satisfies ChipAccent\n\nconst chipTones = ['quiet', 'outline', 'tint'] as const satisfies readonly ChipTone[]\n\nconst chipSizes = ['sm', 'md'] as const satisfies readonly ChipSize[]\n\nconst chipAccents = [\n 'neutral',\n 'accent',\n 'info',\n 'success',\n 'warning',\n 'danger',\n] as const satisfies readonly ChipAccent[]\n\nconst HIT_AREA = hitArea('after:h-tf-target')\n\nconst TINT = {\n accent: 'bg-tf-accent-tint text-tf-accent-hi [--tf-mark-rest:var(--color-tf-accent-edge)]',\n danger: 'bg-tf-danger-tint text-tf-danger-hi [--tf-mark-rest:var(--color-tf-danger-edge)]',\n info: 'bg-tf-info-tint text-tf-info-hi [--tf-mark-rest:var(--color-tf-info-edge)]',\n neutral: 'bg-tf-panel text-tf-fg',\n success: 'bg-tf-success-tint text-tf-success-hi [--tf-mark-rest:var(--color-tf-success-edge)]',\n warning: 'bg-tf-warning-tint text-tf-warning-hi [--tf-mark-rest:var(--color-tf-warning-edge)]',\n} satisfies Record<ChipAccent, string>\n\nconst OUTLINE = {\n accent: 'text-tf-accent-hi blend-tf-accent',\n danger: 'text-tf-danger-hi blend-tf-danger',\n info: 'text-tf-info-hi blend-tf-info',\n neutral: 'text-tf-fg blend-tf-accent',\n success: 'text-tf-success-hi blend-tf-success',\n warning: 'text-tf-warning-hi blend-tf-warning',\n} satisfies Record<ChipAccent, string>\n\nconst LEAVES = [\n 'motion-safe:tf-chip-arrives',\n 'data-[state=closed]:overflow-hidden',\n 'data-[state=closed]:**:data-[part=label]:flex-none',\n 'data-[state=closed]:motion-safe:tf-chip-departs',\n 'motion-reduce:animate-none',\n].join(' ')\n\nconst chipRecipe = cva(\n [\n 'relative isolate inline-flex max-w-full min-w-0 flex-none items-center rounded-tf-pill',\n 'font-tf-body font-medium whitespace-nowrap',\n 'tf-icons [&>svg]:shrink-0',\n 'data-disabled:opacity-50',\n 'tf-transition motion-reduce:transition-none',\n ],\n {\n compoundVariants: [\n ...chipAccents.map((accent) => ({ accent, class: TINT[accent], tone: 'tint' as const })),\n ...chipAccents.map((accent) => ({\n accent,\n class: OUTLINE[accent],\n tone: 'outline' as const,\n })),\n ],\n defaultVariants: {\n accent: defaultChipAccent,\n removable: false,\n size: defaultChipSize,\n tone: defaultChipTone,\n },\n variants: {\n accent: {\n accent: '',\n danger: '',\n info: '',\n neutral: '',\n success: '',\n warning: '',\n } satisfies Record<ChipAccent, string>,\n removable: { false: '', true: LEAVES },\n size: {\n md: 'h-tf-row gap-2 px-3 text-tf-body-sm [&>svg]:size-tf-icon-sm',\n sm: 'h-tf-chip-sm gap-1.5 px-2 text-tf-caption-sm [&>svg]:size-tf-icon-2xs',\n } satisfies Record<ChipSize, string>,\n tone: {\n outline: 'tf-blend-outline',\n quiet: 'bg-tf-panel text-tf-fg tf-mark-edge',\n tint: 'tf-mark-edge **:data-[part=count]:text-current',\n } satisfies Record<ChipTone, string>,\n },\n },\n)\n\nconst chipDotRecipe = cva('size-2 flex-none rounded-tf-pill', {\n defaultVariants: { accent: defaultChipAccent },\n variants: {\n accent: {\n accent: 'bg-tf-accent-hi',\n danger: 'bg-tf-danger-hi',\n info: 'bg-tf-info-hi',\n neutral: 'bg-tf-muted',\n success: 'bg-tf-success-hi',\n warning: 'bg-tf-warning-hi',\n } satisfies Record<ChipAccent, string>,\n },\n})\n\nconst chipTextRecipe = cva('flex min-w-0 items-baseline gap-[inherit]')\n\nconst chipLabelRecipe = cva('min-w-0 truncate')\n\nconst chipCountRecipe = cva('flex-none font-mono text-tf-caption-sm text-tf-muted tabular-nums')\n\nconst CLOSE_HELD = [\n 'disabled:cursor-not-allowed',\n 'aria-disabled:cursor-not-allowed',\n 'data-disabled:cursor-not-allowed',\n]\n\nconst chipCloseRecipe = cva([\n 'relative inline-flex size-tf-icon-md flex-none items-center justify-center rounded-tf-pill',\n '[&_svg]:size-tf-icon-2xs [&_svg]:shrink-0',\n 'text-tf-muted interactive:hovered:bg-tf-panel-hi interactive:hovered:text-tf-fg',\n 'cursor-pointer tf-transition motion-reduce:transition-none',\n HIT_AREA,\n ...controlReach,\n ...controlPress,\n ...CLOSE_HELD,\n])\n\nexport {\n type ChipAccent,\n type ChipSize,\n type ChipTone,\n chipAccents,\n chipCloseRecipe,\n chipCountRecipe,\n chipDotRecipe,\n chipLabelRecipe,\n chipRecipe,\n chipSizes,\n chipTextRecipe,\n chipTones,\n defaultChipAccent,\n defaultChipSize,\n defaultChipTone,\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"chip.js","names":[],"sources":["../../src/recipes/chip.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\nimport { controlPress, controlReach, hitArea } from '#parts/control'\n\ntype ChipTone = 'quiet' | 'outline' | 'tint'\n\ntype ChipSize = 'sm' | 'md'\n\ntype ChipAccent = 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'\n\nconst defaultChipTone = 'quiet' satisfies ChipTone\n\nconst defaultChipSize = 'md' satisfies ChipSize\n\nconst defaultChipAccent = 'neutral' satisfies ChipAccent\n\nconst chipTones = ['quiet', 'outline', 'tint'] as const satisfies readonly ChipTone[]\n\nconst chipSizes = ['sm', 'md'] as const satisfies readonly ChipSize[]\n\nconst chipAccents = [\n 'neutral',\n 'accent',\n 'info',\n 'success',\n 'warning',\n 'danger',\n] as const satisfies readonly ChipAccent[]\n\nconst HIT_AREA = hitArea('after:h-tf-target')\n\nconst TINT = {\n accent: 'bg-tf-accent-tint text-tf-accent-hi [--tf-mark-rest:var(--color-tf-accent-edge)]',\n danger: 'bg-tf-danger-tint text-tf-danger-hi [--tf-mark-rest:var(--color-tf-danger-edge)]',\n info: 'bg-tf-info-tint text-tf-info-hi [--tf-mark-rest:var(--color-tf-info-edge)]',\n neutral: 'bg-tf-panel text-tf-fg',\n success: 'bg-tf-success-tint text-tf-success-hi [--tf-mark-rest:var(--color-tf-success-edge)]',\n warning: 'bg-tf-warning-tint text-tf-warning-hi [--tf-mark-rest:var(--color-tf-warning-edge)]',\n} satisfies Record<ChipAccent, string>\n\nconst OUTLINE = {\n accent: 'text-tf-accent-hi blend-tf-accent',\n danger: 'text-tf-danger-hi blend-tf-danger',\n info: 'text-tf-info-hi blend-tf-info',\n neutral: 'text-tf-fg blend-tf-accent',\n success: 'text-tf-success-hi blend-tf-success',\n warning: 'text-tf-warning-hi blend-tf-warning',\n} satisfies Record<ChipAccent, string>\n\nconst LEAVES = [\n 'motion-safe:tf-chip-arrives',\n 'data-[state=closed]:overflow-hidden',\n 'data-[state=closed]:**:data-[part=label]:flex-none',\n 'data-[state=closed]:motion-safe:tf-chip-departs',\n 'motion-reduce:animate-none',\n].join(' ')\n\nconst chipRecipe = cva(\n [\n 'relative isolate inline-flex max-w-full min-w-0 flex-none items-center rounded-tf-pill',\n 'font-tf-body font-medium whitespace-nowrap',\n 'tf-icons [&>svg]:shrink-0',\n 'data-disabled:opacity-50',\n 'tf-transition motion-reduce:transition-none',\n ],\n {\n compoundVariants: [\n ...chipAccents.map((accent) => ({ accent, class: TINT[accent], tone: 'tint' as const })),\n ...chipAccents.map((accent) => ({\n accent,\n class: OUTLINE[accent],\n tone: 'outline' as const,\n })),\n ],\n defaultVariants: {\n accent: defaultChipAccent,\n removable: false,\n size: defaultChipSize,\n tone: defaultChipTone,\n },\n variants: {\n accent: {\n accent: '',\n danger: '',\n info: '',\n neutral: '',\n success: '',\n warning: '',\n } satisfies Record<ChipAccent, string>,\n removable: { false: '', true: LEAVES },\n size: {\n md: 'h-tf-row gap-2 px-3 text-tf-body-sm [&>svg]:size-tf-icon-sm',\n sm: 'h-tf-chip-sm gap-1.5 px-2 text-tf-caption-sm [&>svg]:size-tf-icon-2xs',\n } satisfies Record<ChipSize, string>,\n tone: {\n outline: 'tf-blend-outline',\n quiet: 'bg-tf-panel text-tf-fg tf-mark-edge',\n tint: 'tf-mark-edge **:data-[part=count]:text-current',\n } satisfies Record<ChipTone, string>,\n },\n },\n)\n\nconst chipDotRecipe = cva('size-2 flex-none rounded-tf-pill', {\n defaultVariants: { accent: defaultChipAccent },\n variants: {\n accent: {\n accent: 'bg-tf-accent-hi',\n danger: 'bg-tf-danger-hi',\n info: 'bg-tf-info-hi',\n neutral: 'bg-tf-muted',\n success: 'bg-tf-success-hi',\n warning: 'bg-tf-warning-hi',\n } satisfies Record<ChipAccent, string>,\n },\n})\n\nconst chipTextRecipe = cva('flex min-w-0 items-baseline gap-[inherit]')\n\nconst chipLabelRecipe = cva('min-w-0 truncate')\n\nconst chipCountRecipe = cva('flex-none font-mono text-tf-caption-sm text-tf-muted tabular-nums')\n\nconst CLOSE_HELD = [\n 'disabled:cursor-not-allowed',\n 'aria-disabled:cursor-not-allowed',\n 'data-disabled:cursor-not-allowed',\n]\n\nconst chipCloseRecipe = cva([\n 'relative inline-flex size-tf-icon-md flex-none items-center justify-center rounded-tf-pill',\n '[&_svg]:size-tf-icon-2xs [&_svg]:shrink-0',\n 'text-tf-muted interactive:hovered:bg-tf-panel-hi interactive:hovered:text-tf-fg',\n 'cursor-pointer tf-transition motion-reduce:transition-none',\n HIT_AREA,\n ...controlReach,\n ...controlPress,\n ...CLOSE_HELD,\n])\n\nconst chipAnatomy = anatomy({\n close: { part: 'close', recipe: chipCloseRecipe, required: false },\n count: { part: 'count', recipe: chipCountRecipe, required: false },\n dot: { part: 'dot', recipe: chipDotRecipe, required: false },\n label: { part: 'label', recipe: chipLabelRecipe, required: true },\n root: { part: 'chip', recipe: chipRecipe, required: true },\n text: { part: 'text', recipe: chipTextRecipe, required: true },\n})\n\nexport {\n type ChipAccent,\n type ChipSize,\n type ChipTone,\n chipAccents,\n chipAnatomy,\n chipCloseRecipe,\n chipCountRecipe,\n chipDotRecipe,\n chipLabelRecipe,\n chipRecipe,\n chipSizes,\n chipTextRecipe,\n chipTones,\n defaultChipAccent,\n defaultChipSize,\n defaultChipTone,\n}\n"],"mappings":";;;;AAWA,MAAM,kBAAkB;AAExB,MAAM,kBAAkB;AAExB,MAAM,oBAAoB;AAE1B,MAAM,YAAY;CAAC;CAAS;CAAW;AAAM;AAE7C,MAAM,YAAY,CAAC,MAAM,IAAI;AAE7B,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,WAAW,QAAQ,mBAAmB;AAE5C,MAAM,OAAO;CACX,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,SAAS;CACT,SAAS;CACT,SAAS;AACX;AAEA,MAAM,UAAU;CACd,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,SAAS;CACT,SAAS;CACT,SAAS;AACX;AAEA,MAAM,SAAS;CACb;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;AAEV,MAAM,aAAa,IACjB;CACE;CACA;CACA;CACA;CACA;AACF,GACA;CACE,kBAAkB,CAChB,GAAG,YAAY,KAAK,YAAY;EAAE;EAAQ,OAAO,KAAK;EAAS,MAAM;CAAgB,EAAE,GACvF,GAAG,YAAY,KAAK,YAAY;EAC9B;EACA,OAAO,QAAQ;EACf,MAAM;CACR,EAAE,CACJ;CACA,iBAAiB;EACf,QAAQ;EACR,WAAW;EACX,MAAA;EACA,MAAM;CACR;CACA,UAAU;EACR,QAAQ;GACN,QAAQ;GACR,QAAQ;GACR,MAAM;GACN,SAAS;GACT,SAAS;GACT,SAAS;EACX;EACA,WAAW;GAAE,OAAO;GAAI,MAAM;EAAO;EACrC,MAAM;GACJ,IAAI;GACJ,IAAI;EACN;EACA,MAAM;GACJ,SAAS;GACT,OAAO;GACP,MAAM;EACR;CACF;AACF,CACF;AAEA,MAAM,gBAAgB,IAAI,oCAAoC;CAC5D,iBAAiB,EAAE,QAAQ,kBAAkB;CAC7C,UAAU,EACR,QAAQ;EACN,QAAQ;EACR,QAAQ;EACR,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;CACX,EACF;AACF,CAAC;AAED,MAAM,iBAAiB,IAAI,2CAA2C;AAEtE,MAAM,kBAAkB,IAAI,kBAAkB;AAE9C,MAAM,kBAAkB,IAAI,mEAAmE;AAE/F,MAAM,aAAa;CACjB;CACA;CACA;AACF;AAEA,MAAM,kBAAkB,IAAI;CAC1B;CACA;CACA;CACA;CACA;CACA,GAAG;CACH,GAAG;CACH,GAAG;AACL,CAAC;AAED,MAAM,cAAc,QAAQ;CAC1B,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAiB,UAAU;CAAM;CACjE,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAiB,UAAU;CAAM;CACjE,KAAK;EAAE,MAAM;EAAO,QAAQ;EAAe,UAAU;CAAM;CAC3D,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAiB,UAAU;CAAK;CAChE,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAY,UAAU;CAAK;CACzD,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAgB,UAAU;CAAK;AAC/D,CAAC"}
|
|
@@ -69,6 +69,13 @@ declare const codeSyntaxColors: {
|
|
|
69
69
|
punctuation: string;
|
|
70
70
|
text: string;
|
|
71
71
|
};
|
|
72
|
+
declare const codeEditorAnatomy: {
|
|
73
|
+
readonly root: {
|
|
74
|
+
readonly part: "code-editor";
|
|
75
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
76
|
+
readonly required: true;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
72
79
|
//#endregion
|
|
73
|
-
export { codeEditorRecipe, codeEditorTheme, codeSyntaxColors };
|
|
80
|
+
export { codeEditorAnatomy, codeEditorRecipe, codeEditorTheme, codeSyntaxColors };
|
|
74
81
|
//# sourceMappingURL=codeEditor.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { anatomy } from "../anatomy.js";
|
|
1
2
|
import { cva } from "class-variance-authority";
|
|
2
3
|
//#region src/recipes/codeEditor.ts
|
|
3
4
|
const PAD = "calc(var(--spacing) * 4)";
|
|
@@ -65,7 +66,12 @@ const codeSyntaxColors = {
|
|
|
65
66
|
punctuation: "var(--color-tf-muted)",
|
|
66
67
|
text: "var(--color-tf-success-hi)"
|
|
67
68
|
};
|
|
69
|
+
const codeEditorAnatomy = anatomy({ root: {
|
|
70
|
+
part: "code-editor",
|
|
71
|
+
recipe: codeEditorRecipe,
|
|
72
|
+
required: true
|
|
73
|
+
} });
|
|
68
74
|
//#endregion
|
|
69
|
-
export { codeEditorRecipe, codeEditorTheme, codeSyntaxColors };
|
|
75
|
+
export { codeEditorAnatomy, codeEditorRecipe, codeEditorTheme, codeSyntaxColors };
|
|
70
76
|
|
|
71
77
|
//# sourceMappingURL=codeEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeEditor.js","names":[],"sources":["../../src/recipes/codeEditor.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nconst PAD = 'calc(var(--spacing) * 4)'\n\nconst LIFT = 'var(--color-tf-panel-2)'\n\nconst LEADING = 'var(--text-tf-caption-sm--line-height)'\n\nconst codeEditorRecipe = cva([\n 'relative isolate w-full overflow-hidden rounded-tf-control',\n 'empty:min-h-(--tf-code-height)',\n 'bg-tf-sunken font-tf-body blend-tf-accent',\n 'tf-edge-sweep tf-edge-plain reached:tf-edge-lit',\n 'tf-transition motion-reduce:transition-none',\n])\n\nconst codeEditorTheme = {\n '&': {\n backgroundColor: 'transparent',\n color: 'var(--color-tf-fg)',\n fontSize: 'var(--text-tf-caption-sm)',\n lineHeight: LEADING,\n maxHeight: 'var(--tf-code-height)',\n },\n '&.cm-focused': { outline: 'none' },\n '&:not(.cm-focused) .cm-activeLine': { backgroundColor: 'transparent' },\n '&:not(.cm-focused) .cm-activeLineGutter': {\n backgroundColor: 'transparent',\n color: 'inherit',\n },\n '.cm-activeLine': { backgroundColor: LIFT },\n '.cm-activeLineGutter': { backgroundColor: LIFT, color: 'var(--color-tf-fg)' },\n '.cm-content': {\n caretColor: 'var(--color-tf-accent-hi)',\n fontFamily: 'var(--font-mono)',\n padding: '0',\n },\n '.cm-cursor': { borderLeftColor: 'var(--color-tf-accent-hi)' },\n '.cm-gutters': {\n backgroundColor: 'transparent',\n border: 'none',\n color: 'var(--color-tf-muted)',\n fontFamily: 'var(--font-mono)',\n paddingLeft: PAD,\n },\n '.cm-line': {\n padding: `0 ${PAD}`,\n transition: 'background-color var(--tf-timing-quick)',\n },\n '.cm-lineNumbers .cm-gutterElement': { minWidth: 'calc(var(--spacing) * 4)' },\n '.cm-placeholder': { color: 'var(--color-tf-muted)' },\n '.cm-scroller': {\n fontFamily: 'inherit',\n lineHeight: LEADING,\n overflow: 'auto',\n padding: `${PAD} 0`,\n scrollbarColor: 'var(--color-tf-line-hi) transparent',\n scrollbarWidth: 'thin',\n },\n '.cm-selectionBackground': { backgroundColor: 'var(--color-tf-control) !important' },\n}\n\nconst codeSyntaxColors = {\n key: 'var(--color-tf-info-hi)',\n literal: 'var(--color-tf-accent-hi)',\n number: 'var(--color-tf-warning-hi)',\n punctuation: 'var(--color-tf-muted)',\n text: 'var(--color-tf-success-hi)',\n}\n\nexport { codeEditorRecipe, codeEditorTheme, codeSyntaxColors }\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"codeEditor.js","names":[],"sources":["../../src/recipes/codeEditor.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\n\nconst PAD = 'calc(var(--spacing) * 4)'\n\nconst LIFT = 'var(--color-tf-panel-2)'\n\nconst LEADING = 'var(--text-tf-caption-sm--line-height)'\n\nconst codeEditorRecipe = cva([\n 'relative isolate w-full overflow-hidden rounded-tf-control',\n 'empty:min-h-(--tf-code-height)',\n 'bg-tf-sunken font-tf-body blend-tf-accent',\n 'tf-edge-sweep tf-edge-plain reached:tf-edge-lit',\n 'tf-transition motion-reduce:transition-none',\n])\n\nconst codeEditorTheme = {\n '&': {\n backgroundColor: 'transparent',\n color: 'var(--color-tf-fg)',\n fontSize: 'var(--text-tf-caption-sm)',\n lineHeight: LEADING,\n maxHeight: 'var(--tf-code-height)',\n },\n '&.cm-focused': { outline: 'none' },\n '&:not(.cm-focused) .cm-activeLine': { backgroundColor: 'transparent' },\n '&:not(.cm-focused) .cm-activeLineGutter': {\n backgroundColor: 'transparent',\n color: 'inherit',\n },\n '.cm-activeLine': { backgroundColor: LIFT },\n '.cm-activeLineGutter': { backgroundColor: LIFT, color: 'var(--color-tf-fg)' },\n '.cm-content': {\n caretColor: 'var(--color-tf-accent-hi)',\n fontFamily: 'var(--font-mono)',\n padding: '0',\n },\n '.cm-cursor': { borderLeftColor: 'var(--color-tf-accent-hi)' },\n '.cm-gutters': {\n backgroundColor: 'transparent',\n border: 'none',\n color: 'var(--color-tf-muted)',\n fontFamily: 'var(--font-mono)',\n paddingLeft: PAD,\n },\n '.cm-line': {\n padding: `0 ${PAD}`,\n transition: 'background-color var(--tf-timing-quick)',\n },\n '.cm-lineNumbers .cm-gutterElement': { minWidth: 'calc(var(--spacing) * 4)' },\n '.cm-placeholder': { color: 'var(--color-tf-muted)' },\n '.cm-scroller': {\n fontFamily: 'inherit',\n lineHeight: LEADING,\n overflow: 'auto',\n padding: `${PAD} 0`,\n scrollbarColor: 'var(--color-tf-line-hi) transparent',\n scrollbarWidth: 'thin',\n },\n '.cm-selectionBackground': { backgroundColor: 'var(--color-tf-control) !important' },\n}\n\nconst codeSyntaxColors = {\n key: 'var(--color-tf-info-hi)',\n literal: 'var(--color-tf-accent-hi)',\n number: 'var(--color-tf-warning-hi)',\n punctuation: 'var(--color-tf-muted)',\n text: 'var(--color-tf-success-hi)',\n}\n\nconst codeEditorAnatomy = anatomy({\n root: { part: 'code-editor', recipe: codeEditorRecipe, required: true },\n})\n\nexport { codeEditorAnatomy, codeEditorRecipe, codeEditorTheme, codeSyntaxColors }\n"],"mappings":";;;AAIA,MAAM,MAAM;AAEZ,MAAM,OAAO;AAEb,MAAM,UAAU;AAEhB,MAAM,mBAAmB,IAAI;CAC3B;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,kBAAkB;CACtB,KAAK;EACH,iBAAiB;EACjB,OAAO;EACP,UAAU;EACV,YAAY;EACZ,WAAW;CACb;CACA,gBAAgB,EAAE,SAAS,OAAO;CAClC,qCAAqC,EAAE,iBAAiB,cAAc;CACtE,2CAA2C;EACzC,iBAAiB;EACjB,OAAO;CACT;CACA,kBAAkB,EAAE,iBAAiB,KAAK;CAC1C,wBAAwB;EAAE,iBAAiB;EAAM,OAAO;CAAqB;CAC7E,eAAe;EACb,YAAY;EACZ,YAAY;EACZ,SAAS;CACX;CACA,cAAc,EAAE,iBAAiB,4BAA4B;CAC7D,eAAe;EACb,iBAAiB;EACjB,QAAQ;EACR,OAAO;EACP,YAAY;EACZ,aAAa;CACf;CACA,YAAY;EACV,SAAS,KAAK;EACd,YAAY;CACd;CACA,qCAAqC,EAAE,UAAU,2BAA2B;CAC5E,mBAAmB,EAAE,OAAO,wBAAwB;CACpD,gBAAgB;EACd,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,SAAS,GAAG,IAAI;EAChB,gBAAgB;EAChB,gBAAgB;CAClB;CACA,2BAA2B,EAAE,iBAAiB,qCAAqC;AACrF;AAEA,MAAM,mBAAmB;CACvB,KAAK;CACL,SAAS;CACT,QAAQ;CACR,aAAa;CACb,MAAM;AACR;AAEA,MAAM,oBAAoB,QAAQ,EAChC,MAAM;CAAE,MAAM;CAAe,QAAQ;CAAkB,UAAU;AAAK,EACxE,CAAC"}
|
|
@@ -34,6 +34,67 @@ declare const datePickerFootRecipe: (props?: import("class-variance-authority/ty
|
|
|
34
34
|
declare const datePickerPresetRecipe: (props?: ({
|
|
35
35
|
current?: boolean | null | undefined;
|
|
36
36
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
37
|
+
declare const datePickerAnatomy: {
|
|
38
|
+
readonly body: {
|
|
39
|
+
readonly part: "body";
|
|
40
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
41
|
+
readonly required: true;
|
|
42
|
+
};
|
|
43
|
+
readonly dash: {
|
|
44
|
+
readonly part: "dash";
|
|
45
|
+
readonly recipe: (props?: ({
|
|
46
|
+
filled?: boolean | null | undefined;
|
|
47
|
+
labelled?: boolean | null | undefined;
|
|
48
|
+
size?: "md" | "lg" | null | undefined;
|
|
49
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
50
|
+
readonly required: false;
|
|
51
|
+
};
|
|
52
|
+
readonly foot: {
|
|
53
|
+
readonly part: "foot";
|
|
54
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
55
|
+
readonly required: true;
|
|
56
|
+
};
|
|
57
|
+
readonly leading: {
|
|
58
|
+
readonly part: "leading";
|
|
59
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
60
|
+
readonly required: true;
|
|
61
|
+
};
|
|
62
|
+
readonly presets: {
|
|
63
|
+
readonly part: "presets";
|
|
64
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
65
|
+
readonly required: false;
|
|
66
|
+
};
|
|
67
|
+
readonly rangeLabel: {
|
|
68
|
+
readonly part: "range-label";
|
|
69
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
70
|
+
readonly required: true;
|
|
71
|
+
};
|
|
72
|
+
readonly root: {
|
|
73
|
+
readonly part: "date-picker";
|
|
74
|
+
readonly recipe: (props?: ({
|
|
75
|
+
fullWidth?: boolean | null | undefined;
|
|
76
|
+
message?: boolean | null | undefined;
|
|
77
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
78
|
+
readonly required: true;
|
|
79
|
+
};
|
|
80
|
+
readonly row: {
|
|
81
|
+
readonly part: "row";
|
|
82
|
+
readonly recipe: (props?: ({
|
|
83
|
+
ranged?: boolean | null | undefined;
|
|
84
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
85
|
+
readonly required: true;
|
|
86
|
+
};
|
|
87
|
+
readonly rule: {
|
|
88
|
+
readonly part: "rule";
|
|
89
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
90
|
+
readonly required: true;
|
|
91
|
+
};
|
|
92
|
+
readonly views: {
|
|
93
|
+
readonly part: "views";
|
|
94
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
95
|
+
readonly required: true;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
37
98
|
//#endregion
|
|
38
|
-
export { type DatePickerMode, type DatePickerRangePreset, datePickerBodyRecipe, datePickerContentRecipe, datePickerDashRecipe, datePickerDayRecipe, datePickerEndRecipe, datePickerFootRecipe, datePickerGridRecipe, datePickerHeadRecipe, datePickerModes, datePickerNavRecipe, datePickerPresetRecipe, datePickerRangePresets, datePickerRangeTextRecipe, datePickerRowRecipe, datePickerRuleRecipe, datePickerStartRecipe, datePickerTriggerRecipe, datePickerValueRecipe, datePickerViewRecipe, datePickerViewTriggerRecipe, datePickerViewsRecipe, datePickerWeekCellRecipe, defaultDatePickerMode };
|
|
99
|
+
export { type DatePickerMode, type DatePickerRangePreset, datePickerAnatomy, datePickerBodyRecipe, datePickerContentRecipe, datePickerDashRecipe, datePickerDayRecipe, datePickerEndRecipe, datePickerFootRecipe, datePickerGridRecipe, datePickerHeadRecipe, datePickerModes, datePickerNavRecipe, datePickerPresetRecipe, datePickerRangePresets, datePickerRangeTextRecipe, datePickerRowRecipe, datePickerRuleRecipe, datePickerStartRecipe, datePickerTriggerRecipe, datePickerValueRecipe, datePickerViewRecipe, datePickerViewTriggerRecipe, datePickerViewsRecipe, datePickerWeekCellRecipe, defaultDatePickerMode };
|
|
39
100
|
//# sourceMappingURL=datePicker.d.ts.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import { anatomy } from "../anatomy.js";
|
|
2
2
|
import { controlInert, controlPress, controlQuiet, controlQuietIcon, controlReach } from "../parts/control.js";
|
|
3
3
|
import { ruleQuiet } from "../parts/rule.js";
|
|
4
|
+
import "../control.js";
|
|
4
5
|
import { eyebrowQuiet } from "../parts/eyebrow.js";
|
|
5
|
-
import { trailingActionRecipe } from "./field.js";
|
|
6
|
+
import { fieldFootRecipe, fieldRecipe, leadingRecipe, trailingActionRecipe } from "./field.js";
|
|
6
7
|
import { TRAILING_INSET, labelRoom } from "./input.js";
|
|
7
8
|
import { cva } from "class-variance-authority";
|
|
8
9
|
//#region src/recipes/datePicker.ts
|
|
@@ -160,7 +161,59 @@ const datePickerPresetRecipe = cva([
|
|
|
160
161
|
true: "bg-tf-blend text-tf-on-accent interactive:hovered:tf-blended"
|
|
161
162
|
} }
|
|
162
163
|
});
|
|
164
|
+
const datePickerAnatomy = anatomy({
|
|
165
|
+
body: {
|
|
166
|
+
part: "body",
|
|
167
|
+
recipe: datePickerBodyRecipe,
|
|
168
|
+
required: true
|
|
169
|
+
},
|
|
170
|
+
dash: {
|
|
171
|
+
part: "dash",
|
|
172
|
+
recipe: datePickerDashRecipe,
|
|
173
|
+
required: false
|
|
174
|
+
},
|
|
175
|
+
foot: {
|
|
176
|
+
part: "foot",
|
|
177
|
+
recipe: fieldFootRecipe,
|
|
178
|
+
required: true
|
|
179
|
+
},
|
|
180
|
+
leading: {
|
|
181
|
+
part: "leading",
|
|
182
|
+
recipe: leadingRecipe,
|
|
183
|
+
required: true
|
|
184
|
+
},
|
|
185
|
+
presets: {
|
|
186
|
+
part: "presets",
|
|
187
|
+
recipe: datePickerFootRecipe,
|
|
188
|
+
required: false
|
|
189
|
+
},
|
|
190
|
+
rangeLabel: {
|
|
191
|
+
part: "range-label",
|
|
192
|
+
recipe: datePickerRangeTextRecipe,
|
|
193
|
+
required: true
|
|
194
|
+
},
|
|
195
|
+
root: {
|
|
196
|
+
part: "date-picker",
|
|
197
|
+
recipe: fieldRecipe,
|
|
198
|
+
required: true
|
|
199
|
+
},
|
|
200
|
+
row: {
|
|
201
|
+
part: "row",
|
|
202
|
+
recipe: datePickerRowRecipe,
|
|
203
|
+
required: true
|
|
204
|
+
},
|
|
205
|
+
rule: {
|
|
206
|
+
part: "rule",
|
|
207
|
+
recipe: datePickerRuleRecipe,
|
|
208
|
+
required: true
|
|
209
|
+
},
|
|
210
|
+
views: {
|
|
211
|
+
part: "views",
|
|
212
|
+
recipe: datePickerViewsRecipe,
|
|
213
|
+
required: true
|
|
214
|
+
}
|
|
215
|
+
});
|
|
163
216
|
//#endregion
|
|
164
|
-
export { datePickerBodyRecipe, datePickerContentRecipe, datePickerDashRecipe, datePickerDayRecipe, datePickerEndRecipe, datePickerFootRecipe, datePickerGridRecipe, datePickerHeadRecipe, datePickerModes, datePickerNavRecipe, datePickerPresetRecipe, datePickerRangePresets, datePickerRangeTextRecipe, datePickerRowRecipe, datePickerRuleRecipe, datePickerStartRecipe, datePickerTriggerRecipe, datePickerValueRecipe, datePickerViewRecipe, datePickerViewTriggerRecipe, datePickerViewsRecipe, datePickerWeekCellRecipe, defaultDatePickerMode };
|
|
217
|
+
export { datePickerAnatomy, datePickerBodyRecipe, datePickerContentRecipe, datePickerDashRecipe, datePickerDayRecipe, datePickerEndRecipe, datePickerFootRecipe, datePickerGridRecipe, datePickerHeadRecipe, datePickerModes, datePickerNavRecipe, datePickerPresetRecipe, datePickerRangePresets, datePickerRangeTextRecipe, datePickerRowRecipe, datePickerRuleRecipe, datePickerStartRecipe, datePickerTriggerRecipe, datePickerValueRecipe, datePickerViewRecipe, datePickerViewTriggerRecipe, datePickerViewsRecipe, datePickerWeekCellRecipe, defaultDatePickerMode };
|
|
165
218
|
|
|
166
219
|
//# sourceMappingURL=datePicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datePicker.js","names":[],"sources":["../../src/recipes/datePicker.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport type { FieldSize } from '#control'\nimport { defaultFieldSize } from '#control'\nimport {\n controlInert,\n controlPress,\n controlQuiet,\n controlQuietIcon,\n controlReach,\n} from '#parts/control'\nimport { eyebrowQuiet } from '#parts/eyebrow'\nimport { ruleQuiet } from '#parts/rule'\n\nimport { trailingActionRecipe } from './field'\nimport { labelRoom, TRAILING_INSET } from './input'\n\ntype DatePickerMode = 'single' | 'range'\n\nconst defaultDatePickerMode = 'single' satisfies DatePickerMode\n\nconst datePickerModes = ['single', 'range'] as const satisfies readonly DatePickerMode[]\n\ntype DatePickerRangePreset =\n | 'thisWeek'\n | 'lastWeek'\n | 'thisMonth'\n | 'lastMonth'\n | 'thisQuarter'\n | 'lastQuarter'\n | 'thisYear'\n | 'lastYear'\n | 'last3Days'\n | 'last7Days'\n | 'last14Days'\n | 'last30Days'\n | 'last90Days'\n\nconst datePickerRangePresets = [\n 'thisWeek',\n 'lastWeek',\n 'thisMonth',\n 'lastMonth',\n 'thisQuarter',\n 'lastQuarter',\n 'thisYear',\n 'lastYear',\n 'last3Days',\n 'last7Days',\n 'last14Days',\n 'last30Days',\n 'last90Days',\n] as const satisfies readonly DatePickerRangePreset[]\n\nconst datePickerRowRecipe = cva(\n [\n 'data-[state=open]:bg-tf-sunken-hi data-[state=open]:tf-edge-lit',\n 'data-[state=open]:**:data-[part=leading]:text-tf-accent-hi',\n 'data-[state=open]:**:data-[part=leading]:stroke-tf-ink',\n 'data-[state=open]:**:data-[part=trigger]:text-tf-accent-hi',\n 'data-[state=open]:**:data-[part=trigger]:stroke-tf-ink',\n 'reached:**:data-[part=trigger]:text-tf-accent-hi',\n 'reached:**:data-[part=trigger]:stroke-tf-ink',\n 'reached:**:data-[part=dash]:opacity-100',\n 'reached:**:data-[part=dash]:delay-(--tf-duration-1)',\n ],\n {\n defaultVariants: { ranged: false },\n variants: {\n ranged: { false: '', true: 'w-fit max-w-full min-w-60' },\n },\n },\n)\n\nconst datePickerTriggerRecipe = cva([trailingActionRecipe(), 'data-[state=open]:rotate-180'])\n\nconst datePickerDashRecipe = cva(\n [\n 'flex flex-none items-center self-stretch px-2',\n 'text-tf-body-sm font-medium text-tf-muted',\n 'tf-transition motion-reduce:transition-none',\n ],\n {\n compoundVariants: [\n { class: labelRoom.lg, labelled: true, size: 'lg' },\n { class: labelRoom.md, labelled: true, size: 'md' },\n ],\n defaultVariants: { filled: false, labelled: true, size: defaultFieldSize },\n variants: {\n filled: { false: 'opacity-0', true: 'opacity-100' },\n labelled: { false: 'py-0', true: '' },\n size: { lg: '', md: '' } satisfies Record<FieldSize, string>,\n },\n },\n)\n\nconst TRIGGER_ROOM = TRAILING_INSET\n\nconst datePickerStartRecipe = cva('field-sizing-content h-full w-auto min-w-36 pr-0 tabular-nums')\n\nconst datePickerEndRecipe = cva([\n 'field-sizing-content h-full w-auto min-w-36 pl-0 tabular-nums',\n TRIGGER_ROOM,\n])\n\nconst datePickerValueRecipe = cva(['tabular-nums', TRIGGER_ROOM])\n\nconst datePickerContentRecipe = cva([\n 'w-tf-panel max-w-[calc(100vw-2rem)] overflow-hidden px-0',\n 'blend-tf-accent',\n])\n\nconst datePickerViewsRecipe = cva('flex min-h-(--container-tf-panel) flex-col')\n\nconst datePickerViewRecipe = cva('flex flex-1 flex-col tf-arrives motion-reduce:transition-none')\n\nconst datePickerHeadRecipe = cva('relative flex flex-none items-center justify-between gap-2 p-2')\n\nconst datePickerRuleRecipe = cva(`absolute inset-x-0 bottom-0 ${ruleQuiet}`)\n\nconst datePickerNavRecipe = cva(controlQuietIcon)\n\nconst datePickerViewTriggerRecipe = cva([\n 'inline-flex h-tf-control-sm items-center gap-2 rounded-tf-control px-3',\n 'font-tf-display text-tf-body-sm font-medium text-tf-fg',\n 'tf-icons [&_svg]:size-tf-icon-sm [&_svg]:shrink-0',\n ...controlQuiet,\n ...controlReach,\n ...controlPress,\n ...controlInert,\n])\n\nconst PAGING = [\n 'data-[going=forward]:[--tf-page-from:calc(var(--spacing)*4)]',\n 'data-[going=back]:[--tf-page-from:calc(var(--spacing)*-4)]',\n 'data-[step=a]:motion-safe:animate-tf-page',\n 'data-[step=b]:motion-safe:animate-tf-page-again',\n]\n\nconst datePickerRangeTextRecipe = cva([\n 'inline-flex min-w-36 items-center justify-center gap-2',\n ...PAGING,\n])\n\nconst datePickerBodyRecipe = cva(['flex flex-1 flex-col px-3 pt-3 pb-1', ...PAGING])\n\nconst datePickerGridRecipe = cva([\n 'w-full flex-1 table-fixed border-separate border-spacing-1',\n 'has-data-[in-hover-range]:**:data-[part=table-cell-trigger]:transition-none',\n])\n\nconst datePickerWeekCellRecipe = cva([`h-tf-row text-tf-caption-sm ${eyebrowQuiet}`])\n\nconst DAY_BAND = [\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-range]:bg-tf-accent-tint',\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-range]:text-tf-accent-hi',\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-range]:rounded-tf-none',\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-hover-range]:bg-tf-accent-tint',\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-hover-range]:text-tf-accent-hi',\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-hover-range]:rounded-tf-none',\n]\n\nconst DAY_ENDS = [\n 'data-[hover-range-start]:bg-tf-blend data-[hover-range-start]:text-tf-on-accent',\n 'data-[hover-range-end]:bg-tf-blend data-[hover-range-end]:text-tf-on-accent',\n 'data-[in-range]:not-data-[range-end]:data-[range-start]:rounded-r-tf-none',\n 'data-[in-range]:not-data-[range-start]:data-[range-end]:rounded-l-tf-none',\n 'data-[in-hover-range]:not-data-[hover-range-end]:data-[hover-range-start]:rounded-r-tf-none',\n 'data-[in-hover-range]:not-data-[hover-range-start]:data-[hover-range-end]:rounded-l-tf-none',\n]\n\nconst DAY_QUIET = [\n 'not-data-selected:not-data-[in-range]:data-weekend:text-tf-muted',\n 'data-[outside-range]:opacity-50',\n]\n\nconst datePickerDayRecipe = cva(\n [\n 'inline-flex w-full items-center justify-center rounded-tf-control',\n 'text-tf-body-sm font-medium text-tf-fg tabular-nums blend-tf-accent',\n 'tf-ramp',\n 'not-data-[in-range]:interactive:hovered:bg-tf-panel-hi',\n 'data-today:tf-mark-edge data-today:tf-mark-lit',\n 'data-today:interactive:hovered:tf-mark-bloomed',\n 'data-selected:bg-tf-blend data-selected:text-tf-on-accent',\n 'motion-safe:data-selected:tf-pops',\n ...DAY_BAND,\n ...DAY_ENDS,\n ...DAY_QUIET,\n 'cursor-pointer tf-transition motion-reduce:transition-none',\n ...controlReach,\n ...controlPress,\n ...controlInert,\n ],\n {\n defaultVariants: { roomy: false },\n variants: {\n roomy: { false: 'h-tf-control-sm', true: 'h-15' },\n },\n },\n)\n\nconst datePickerFootRecipe = cva('flex flex-none flex-wrap gap-2 px-3 pt-2 pb-3')\n\nconst datePickerPresetRecipe = cva(\n [\n 'relative isolate inline-flex h-tf-row flex-none items-center rounded-tf-pill px-3',\n 'text-tf-caption font-medium',\n 'tf-blend-outline blend-tf-accent',\n 'cursor-pointer tf-transition motion-reduce:transition-none',\n ...controlReach,\n ...controlPress,\n ...controlInert,\n ],\n {\n defaultVariants: { current: false },\n variants: {\n current: {\n false: 'text-tf-fg interactive:hovered:bg-tf-panel-hi',\n true: 'bg-tf-blend text-tf-on-accent interactive:hovered:tf-blended',\n },\n },\n },\n)\n\nexport {\n type DatePickerMode,\n type DatePickerRangePreset,\n datePickerBodyRecipe,\n datePickerContentRecipe,\n datePickerDashRecipe,\n datePickerDayRecipe,\n datePickerEndRecipe,\n datePickerFootRecipe,\n datePickerGridRecipe,\n datePickerHeadRecipe,\n datePickerModes,\n datePickerNavRecipe,\n datePickerPresetRecipe,\n datePickerRangePresets,\n datePickerRangeTextRecipe,\n datePickerRowRecipe,\n datePickerRuleRecipe,\n datePickerStartRecipe,\n datePickerTriggerRecipe,\n datePickerValueRecipe,\n datePickerViewRecipe,\n datePickerViewsRecipe,\n datePickerViewTriggerRecipe,\n datePickerWeekCellRecipe,\n defaultDatePickerMode,\n}\n"],"mappings":";;;;;;;;AAmBA,MAAM,wBAAwB;AAE9B,MAAM,kBAAkB,CAAC,UAAU,OAAO;AAiB1C,MAAM,yBAAyB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,sBAAsB,IAC1B;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GACA;CACE,iBAAiB,EAAE,QAAQ,MAAM;CACjC,UAAU,EACR,QAAQ;EAAE,OAAO;EAAI,MAAM;CAA4B,EACzD;AACF,CACF;AAEA,MAAM,0BAA0B,IAAI,CAAC,qBAAqB,GAAG,8BAA8B,CAAC;AAE5F,MAAM,uBAAuB,IAC3B;CACE;CACA;CACA;AACF,GACA;CACE,kBAAkB,CAChB;EAAE,OAAO,UAAU;EAAI,UAAU;EAAM,MAAM;CAAK,GAClD;EAAE,OAAO,UAAU;EAAI,UAAU;EAAM,MAAM;CAAK,CACpD;CACA,iBAAiB;EAAE,QAAQ;EAAO,UAAU;EAAM,MAAA;CAAuB;CACzE,UAAU;EACR,QAAQ;GAAE,OAAO;GAAa,MAAM;EAAc;EAClD,UAAU;GAAE,OAAO;GAAQ,MAAM;EAAG;EACpC,MAAM;GAAE,IAAI;GAAI,IAAI;EAAG;CACzB;AACF,CACF;AAEA,MAAM,eAAe;AAErB,MAAM,wBAAwB,IAAI,+DAA+D;AAEjG,MAAM,sBAAsB,IAAI,CAC9B,iEACA,YACF,CAAC;AAED,MAAM,wBAAwB,IAAI,CAAC,gBAAgB,YAAY,CAAC;AAEhE,MAAM,0BAA0B,IAAI,CAClC,4DACA,iBACF,CAAC;AAED,MAAM,wBAAwB,IAAI,4CAA4C;AAE9E,MAAM,uBAAuB,IAAI,+DAA+D;AAEhG,MAAM,uBAAuB,IAAI,gEAAgE;AAEjG,MAAM,uBAAuB,IAAI,+BAA+B,WAAW;AAE3E,MAAM,sBAAsB,IAAI,gBAAgB;AAEhD,MAAM,8BAA8B,IAAI;CACtC;CACA;CACA;CACA,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL,CAAC;AAED,MAAM,SAAS;CACb;CACA;CACA;CACA;AACF;AAEA,MAAM,4BAA4B,IAAI,CACpC,0DACA,GAAG,MACL,CAAC;AAED,MAAM,uBAAuB,IAAI,CAAC,uCAAuC,GAAG,MAAM,CAAC;AAEnF,MAAM,uBAAuB,IAAI,CAC/B,8DACA,6EACF,CAAC;AAED,MAAM,2BAA2B,IAAI,CAAC,+BAA+B,cAAc,CAAC;AAEpF,MAAM,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,YAAY,CAChB,oEACA,iCACF;AAEA,MAAM,sBAAsB,IAC1B;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAG;CACH,GAAG;CACH,GAAG;CACH;CACA,GAAG;CACH,GAAG;CACH,GAAG;AACL,GACA;CACE,iBAAiB,EAAE,OAAO,MAAM;CAChC,UAAU,EACR,OAAO;EAAE,OAAO;EAAmB,MAAM;CAAO,EAClD;AACF,CACF;AAEA,MAAM,uBAAuB,IAAI,+CAA+C;AAEhF,MAAM,yBAAyB,IAC7B;CACE;CACA;CACA;CACA;CACA,GAAG;CACH,GAAG;CACH,GAAG;AACL,GACA;CACE,iBAAiB,EAAE,SAAS,MAAM;CAClC,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;CACR,EACF;AACF,CACF"}
|
|
1
|
+
{"version":3,"file":"datePicker.js","names":[],"sources":["../../src/recipes/datePicker.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\nimport type { FieldSize } from '#control'\nimport { defaultFieldSize } from '#control'\nimport {\n controlInert,\n controlPress,\n controlQuiet,\n controlQuietIcon,\n controlReach,\n} from '#parts/control'\nimport { eyebrowQuiet } from '#parts/eyebrow'\nimport { ruleQuiet } from '#parts/rule'\n\nimport { fieldFootRecipe, fieldRecipe, leadingRecipe, trailingActionRecipe } from './field'\nimport { labelRoom, TRAILING_INSET } from './input'\n\ntype DatePickerMode = 'single' | 'range'\n\nconst defaultDatePickerMode = 'single' satisfies DatePickerMode\n\nconst datePickerModes = ['single', 'range'] as const satisfies readonly DatePickerMode[]\n\ntype DatePickerRangePreset =\n | 'thisWeek'\n | 'lastWeek'\n | 'thisMonth'\n | 'lastMonth'\n | 'thisQuarter'\n | 'lastQuarter'\n | 'thisYear'\n | 'lastYear'\n | 'last3Days'\n | 'last7Days'\n | 'last14Days'\n | 'last30Days'\n | 'last90Days'\n\nconst datePickerRangePresets = [\n 'thisWeek',\n 'lastWeek',\n 'thisMonth',\n 'lastMonth',\n 'thisQuarter',\n 'lastQuarter',\n 'thisYear',\n 'lastYear',\n 'last3Days',\n 'last7Days',\n 'last14Days',\n 'last30Days',\n 'last90Days',\n] as const satisfies readonly DatePickerRangePreset[]\n\nconst datePickerRowRecipe = cva(\n [\n 'data-[state=open]:bg-tf-sunken-hi data-[state=open]:tf-edge-lit',\n 'data-[state=open]:**:data-[part=leading]:text-tf-accent-hi',\n 'data-[state=open]:**:data-[part=leading]:stroke-tf-ink',\n 'data-[state=open]:**:data-[part=trigger]:text-tf-accent-hi',\n 'data-[state=open]:**:data-[part=trigger]:stroke-tf-ink',\n 'reached:**:data-[part=trigger]:text-tf-accent-hi',\n 'reached:**:data-[part=trigger]:stroke-tf-ink',\n 'reached:**:data-[part=dash]:opacity-100',\n 'reached:**:data-[part=dash]:delay-(--tf-duration-1)',\n ],\n {\n defaultVariants: { ranged: false },\n variants: {\n ranged: { false: '', true: 'w-fit max-w-full min-w-60' },\n },\n },\n)\n\nconst datePickerTriggerRecipe = cva([trailingActionRecipe(), 'data-[state=open]:rotate-180'])\n\nconst datePickerDashRecipe = cva(\n [\n 'flex flex-none items-center self-stretch px-2',\n 'text-tf-body-sm font-medium text-tf-muted',\n 'tf-transition motion-reduce:transition-none',\n ],\n {\n compoundVariants: [\n { class: labelRoom.lg, labelled: true, size: 'lg' },\n { class: labelRoom.md, labelled: true, size: 'md' },\n ],\n defaultVariants: { filled: false, labelled: true, size: defaultFieldSize },\n variants: {\n filled: { false: 'opacity-0', true: 'opacity-100' },\n labelled: { false: 'py-0', true: '' },\n size: { lg: '', md: '' } satisfies Record<FieldSize, string>,\n },\n },\n)\n\nconst TRIGGER_ROOM = TRAILING_INSET\n\nconst datePickerStartRecipe = cva('field-sizing-content h-full w-auto min-w-36 pr-0 tabular-nums')\n\nconst datePickerEndRecipe = cva([\n 'field-sizing-content h-full w-auto min-w-36 pl-0 tabular-nums',\n TRIGGER_ROOM,\n])\n\nconst datePickerValueRecipe = cva(['tabular-nums', TRIGGER_ROOM])\n\nconst datePickerContentRecipe = cva([\n 'w-tf-panel max-w-[calc(100vw-2rem)] overflow-hidden px-0',\n 'blend-tf-accent',\n])\n\nconst datePickerViewsRecipe = cva('flex min-h-(--container-tf-panel) flex-col')\n\nconst datePickerViewRecipe = cva('flex flex-1 flex-col tf-arrives motion-reduce:transition-none')\n\nconst datePickerHeadRecipe = cva('relative flex flex-none items-center justify-between gap-2 p-2')\n\nconst datePickerRuleRecipe = cva(`absolute inset-x-0 bottom-0 ${ruleQuiet}`)\n\nconst datePickerNavRecipe = cva(controlQuietIcon)\n\nconst datePickerViewTriggerRecipe = cva([\n 'inline-flex h-tf-control-sm items-center gap-2 rounded-tf-control px-3',\n 'font-tf-display text-tf-body-sm font-medium text-tf-fg',\n 'tf-icons [&_svg]:size-tf-icon-sm [&_svg]:shrink-0',\n ...controlQuiet,\n ...controlReach,\n ...controlPress,\n ...controlInert,\n])\n\nconst PAGING = [\n 'data-[going=forward]:[--tf-page-from:calc(var(--spacing)*4)]',\n 'data-[going=back]:[--tf-page-from:calc(var(--spacing)*-4)]',\n 'data-[step=a]:motion-safe:animate-tf-page',\n 'data-[step=b]:motion-safe:animate-tf-page-again',\n]\n\nconst datePickerRangeTextRecipe = cva([\n 'inline-flex min-w-36 items-center justify-center gap-2',\n ...PAGING,\n])\n\nconst datePickerBodyRecipe = cva(['flex flex-1 flex-col px-3 pt-3 pb-1', ...PAGING])\n\nconst datePickerGridRecipe = cva([\n 'w-full flex-1 table-fixed border-separate border-spacing-1',\n 'has-data-[in-hover-range]:**:data-[part=table-cell-trigger]:transition-none',\n])\n\nconst datePickerWeekCellRecipe = cva([`h-tf-row text-tf-caption-sm ${eyebrowQuiet}`])\n\nconst DAY_BAND = [\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-range]:bg-tf-accent-tint',\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-range]:text-tf-accent-hi',\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-range]:rounded-tf-none',\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-hover-range]:bg-tf-accent-tint',\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-hover-range]:text-tf-accent-hi',\n 'not-data-selected:not-data-[hover-range-start]:not-data-[hover-range-end]:data-[in-hover-range]:rounded-tf-none',\n]\n\nconst DAY_ENDS = [\n 'data-[hover-range-start]:bg-tf-blend data-[hover-range-start]:text-tf-on-accent',\n 'data-[hover-range-end]:bg-tf-blend data-[hover-range-end]:text-tf-on-accent',\n 'data-[in-range]:not-data-[range-end]:data-[range-start]:rounded-r-tf-none',\n 'data-[in-range]:not-data-[range-start]:data-[range-end]:rounded-l-tf-none',\n 'data-[in-hover-range]:not-data-[hover-range-end]:data-[hover-range-start]:rounded-r-tf-none',\n 'data-[in-hover-range]:not-data-[hover-range-start]:data-[hover-range-end]:rounded-l-tf-none',\n]\n\nconst DAY_QUIET = [\n 'not-data-selected:not-data-[in-range]:data-weekend:text-tf-muted',\n 'data-[outside-range]:opacity-50',\n]\n\nconst datePickerDayRecipe = cva(\n [\n 'inline-flex w-full items-center justify-center rounded-tf-control',\n 'text-tf-body-sm font-medium text-tf-fg tabular-nums blend-tf-accent',\n 'tf-ramp',\n 'not-data-[in-range]:interactive:hovered:bg-tf-panel-hi',\n 'data-today:tf-mark-edge data-today:tf-mark-lit',\n 'data-today:interactive:hovered:tf-mark-bloomed',\n 'data-selected:bg-tf-blend data-selected:text-tf-on-accent',\n 'motion-safe:data-selected:tf-pops',\n ...DAY_BAND,\n ...DAY_ENDS,\n ...DAY_QUIET,\n 'cursor-pointer tf-transition motion-reduce:transition-none',\n ...controlReach,\n ...controlPress,\n ...controlInert,\n ],\n {\n defaultVariants: { roomy: false },\n variants: {\n roomy: { false: 'h-tf-control-sm', true: 'h-15' },\n },\n },\n)\n\nconst datePickerFootRecipe = cva('flex flex-none flex-wrap gap-2 px-3 pt-2 pb-3')\n\nconst datePickerPresetRecipe = cva(\n [\n 'relative isolate inline-flex h-tf-row flex-none items-center rounded-tf-pill px-3',\n 'text-tf-caption font-medium',\n 'tf-blend-outline blend-tf-accent',\n 'cursor-pointer tf-transition motion-reduce:transition-none',\n ...controlReach,\n ...controlPress,\n ...controlInert,\n ],\n {\n defaultVariants: { current: false },\n variants: {\n current: {\n false: 'text-tf-fg interactive:hovered:bg-tf-panel-hi',\n true: 'bg-tf-blend text-tf-on-accent interactive:hovered:tf-blended',\n },\n },\n },\n)\n\nconst datePickerAnatomy = anatomy({\n body: { part: 'body', recipe: datePickerBodyRecipe, required: true },\n dash: { part: 'dash', recipe: datePickerDashRecipe, required: false },\n foot: { part: 'foot', recipe: fieldFootRecipe, required: true },\n leading: { part: 'leading', recipe: leadingRecipe, required: true },\n presets: { part: 'presets', recipe: datePickerFootRecipe, required: false },\n rangeLabel: { part: 'range-label', recipe: datePickerRangeTextRecipe, required: true },\n root: { part: 'date-picker', recipe: fieldRecipe, required: true },\n row: { part: 'row', recipe: datePickerRowRecipe, required: true },\n rule: { part: 'rule', recipe: datePickerRuleRecipe, required: true },\n views: { part: 'views', recipe: datePickerViewsRecipe, required: true },\n})\n\nexport {\n type DatePickerMode,\n type DatePickerRangePreset,\n datePickerAnatomy,\n datePickerBodyRecipe,\n datePickerContentRecipe,\n datePickerDashRecipe,\n datePickerDayRecipe,\n datePickerEndRecipe,\n datePickerFootRecipe,\n datePickerGridRecipe,\n datePickerHeadRecipe,\n datePickerModes,\n datePickerNavRecipe,\n datePickerPresetRecipe,\n datePickerRangePresets,\n datePickerRangeTextRecipe,\n datePickerRowRecipe,\n datePickerRuleRecipe,\n datePickerStartRecipe,\n datePickerTriggerRecipe,\n datePickerValueRecipe,\n datePickerViewRecipe,\n datePickerViewsRecipe,\n datePickerViewTriggerRecipe,\n datePickerWeekCellRecipe,\n defaultDatePickerMode,\n}\n"],"mappings":";;;;;;;;;AAoBA,MAAM,wBAAwB;AAE9B,MAAM,kBAAkB,CAAC,UAAU,OAAO;AAiB1C,MAAM,yBAAyB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,sBAAsB,IAC1B;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GACA;CACE,iBAAiB,EAAE,QAAQ,MAAM;CACjC,UAAU,EACR,QAAQ;EAAE,OAAO;EAAI,MAAM;CAA4B,EACzD;AACF,CACF;AAEA,MAAM,0BAA0B,IAAI,CAAC,qBAAqB,GAAG,8BAA8B,CAAC;AAE5F,MAAM,uBAAuB,IAC3B;CACE;CACA;CACA;AACF,GACA;CACE,kBAAkB,CAChB;EAAE,OAAO,UAAU;EAAI,UAAU;EAAM,MAAM;CAAK,GAClD;EAAE,OAAO,UAAU;EAAI,UAAU;EAAM,MAAM;CAAK,CACpD;CACA,iBAAiB;EAAE,QAAQ;EAAO,UAAU;EAAM,MAAA;CAAuB;CACzE,UAAU;EACR,QAAQ;GAAE,OAAO;GAAa,MAAM;EAAc;EAClD,UAAU;GAAE,OAAO;GAAQ,MAAM;EAAG;EACpC,MAAM;GAAE,IAAI;GAAI,IAAI;EAAG;CACzB;AACF,CACF;AAEA,MAAM,eAAe;AAErB,MAAM,wBAAwB,IAAI,+DAA+D;AAEjG,MAAM,sBAAsB,IAAI,CAC9B,iEACA,YACF,CAAC;AAED,MAAM,wBAAwB,IAAI,CAAC,gBAAgB,YAAY,CAAC;AAEhE,MAAM,0BAA0B,IAAI,CAClC,4DACA,iBACF,CAAC;AAED,MAAM,wBAAwB,IAAI,4CAA4C;AAE9E,MAAM,uBAAuB,IAAI,+DAA+D;AAEhG,MAAM,uBAAuB,IAAI,gEAAgE;AAEjG,MAAM,uBAAuB,IAAI,+BAA+B,WAAW;AAE3E,MAAM,sBAAsB,IAAI,gBAAgB;AAEhD,MAAM,8BAA8B,IAAI;CACtC;CACA;CACA;CACA,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL,CAAC;AAED,MAAM,SAAS;CACb;CACA;CACA;CACA;AACF;AAEA,MAAM,4BAA4B,IAAI,CACpC,0DACA,GAAG,MACL,CAAC;AAED,MAAM,uBAAuB,IAAI,CAAC,uCAAuC,GAAG,MAAM,CAAC;AAEnF,MAAM,uBAAuB,IAAI,CAC/B,8DACA,6EACF,CAAC;AAED,MAAM,2BAA2B,IAAI,CAAC,+BAA+B,cAAc,CAAC;AAEpF,MAAM,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,YAAY,CAChB,oEACA,iCACF;AAEA,MAAM,sBAAsB,IAC1B;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAG;CACH,GAAG;CACH,GAAG;CACH;CACA,GAAG;CACH,GAAG;CACH,GAAG;AACL,GACA;CACE,iBAAiB,EAAE,OAAO,MAAM;CAChC,UAAU,EACR,OAAO;EAAE,OAAO;EAAmB,MAAM;CAAO,EAClD;AACF,CACF;AAEA,MAAM,uBAAuB,IAAI,+CAA+C;AAEhF,MAAM,yBAAyB,IAC7B;CACE;CACA;CACA;CACA;CACA,GAAG;CACH,GAAG;CACH,GAAG;AACL,GACA;CACE,iBAAiB,EAAE,SAAS,MAAM;CAClC,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;CACR,EACF;AACF,CACF;AAEA,MAAM,oBAAoB,QAAQ;CAChC,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAsB,UAAU;CAAK;CACnE,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAsB,UAAU;CAAM;CACpE,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAiB,UAAU;CAAK;CAC9D,SAAS;EAAE,MAAM;EAAW,QAAQ;EAAe,UAAU;CAAK;CAClE,SAAS;EAAE,MAAM;EAAW,QAAQ;EAAsB,UAAU;CAAM;CAC1E,YAAY;EAAE,MAAM;EAAe,QAAQ;EAA2B,UAAU;CAAK;CACrF,MAAM;EAAE,MAAM;EAAe,QAAQ;EAAa,UAAU;CAAK;CACjE,KAAK;EAAE,MAAM;EAAO,QAAQ;EAAqB,UAAU;CAAK;CAChE,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAsB,UAAU;CAAK;CACnE,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAuB,UAAU;CAAK;AACxE,CAAC"}
|
package/dist/recipes/dialog.d.ts
CHANGED
|
@@ -32,6 +32,54 @@ declare const dialogRowRecipe: (props?: import("class-variance-authority/types")
|
|
|
32
32
|
declare const dialogRowValueRecipe: (props?: ({
|
|
33
33
|
lit?: boolean | null | undefined;
|
|
34
34
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
35
|
+
declare const dialogAnatomy: {
|
|
36
|
+
readonly body: {
|
|
37
|
+
readonly part: "body";
|
|
38
|
+
readonly recipe: (props?: ({
|
|
39
|
+
layout?: "panel" | "confirm" | null | undefined;
|
|
40
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
41
|
+
readonly required: true;
|
|
42
|
+
};
|
|
43
|
+
readonly cloud: {
|
|
44
|
+
readonly part: "cloud";
|
|
45
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
46
|
+
readonly required: true;
|
|
47
|
+
};
|
|
48
|
+
readonly footer: {
|
|
49
|
+
readonly part: "footer";
|
|
50
|
+
readonly recipe: (props?: ({
|
|
51
|
+
layout?: "panel" | "confirm" | null | undefined;
|
|
52
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
53
|
+
readonly required: false;
|
|
54
|
+
};
|
|
55
|
+
readonly head: {
|
|
56
|
+
readonly part: "head";
|
|
57
|
+
readonly recipe: (props?: ({
|
|
58
|
+
layout?: "panel" | "confirm" | null | undefined;
|
|
59
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
60
|
+
readonly required: true;
|
|
61
|
+
};
|
|
62
|
+
readonly headings: {
|
|
63
|
+
readonly part: "headings";
|
|
64
|
+
readonly recipe: (props?: ({
|
|
65
|
+
layout?: "panel" | "confirm" | null | undefined;
|
|
66
|
+
roomy?: boolean | null | undefined;
|
|
67
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
68
|
+
readonly required: true;
|
|
69
|
+
};
|
|
70
|
+
readonly nebula: {
|
|
71
|
+
readonly part: "nebula";
|
|
72
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
73
|
+
readonly required: true;
|
|
74
|
+
};
|
|
75
|
+
readonly root: {
|
|
76
|
+
readonly part: "dialog";
|
|
77
|
+
readonly recipe: (props?: ({
|
|
78
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
79
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
80
|
+
readonly required: true;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
35
83
|
//#endregion
|
|
36
|
-
export { type DialogLayout, type DialogSize, defaultDialogLayout, defaultDialogSize, dialogBackdropRecipe, dialogBodyRecipe, dialogCloseRecipe, dialogDescriptionRecipe, dialogFooterRecipe, dialogHeadRecipe, dialogHeadingsRecipe, dialogHeldRecipe, dialogLayouts, dialogNoteRecipe, dialogPositionerRecipe, dialogRecipe, dialogRowRecipe, dialogRowValueRecipe, dialogSizes, dialogTitleRecipe };
|
|
84
|
+
export { type DialogLayout, type DialogSize, defaultDialogLayout, defaultDialogSize, dialogAnatomy, dialogBackdropRecipe, dialogBodyRecipe, dialogCloseRecipe, dialogDescriptionRecipe, dialogFooterRecipe, dialogHeadRecipe, dialogHeadingsRecipe, dialogHeldRecipe, dialogLayouts, dialogNoteRecipe, dialogPositionerRecipe, dialogRecipe, dialogRowRecipe, dialogRowValueRecipe, dialogSizes, dialogTitleRecipe };
|
|
37
85
|
//# sourceMappingURL=dialog.d.ts.map
|
package/dist/recipes/dialog.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { anatomy } from "../anatomy.js";
|
|
1
2
|
import { liftMotion, scrimMirrorMotion } from "./motion.js";
|
|
2
3
|
import { surfaceLifted, surfacePanel } from "../parts/surface.js";
|
|
4
|
+
import { nebulaCloudWideRecipe, nebulaVeilRecipe } from "./nebula.js";
|
|
3
5
|
import { cva } from "class-variance-authority";
|
|
4
6
|
//#region src/recipes/dialog.ts
|
|
5
7
|
const defaultDialogLayout = "panel";
|
|
@@ -110,7 +112,44 @@ const dialogRowValueRecipe = cva("text-tf-fg tabular-nums", {
|
|
|
110
112
|
true: "text-tf-accent-hi"
|
|
111
113
|
} }
|
|
112
114
|
});
|
|
115
|
+
const dialogAnatomy = anatomy({
|
|
116
|
+
body: {
|
|
117
|
+
part: "body",
|
|
118
|
+
recipe: dialogBodyRecipe,
|
|
119
|
+
required: true
|
|
120
|
+
},
|
|
121
|
+
cloud: {
|
|
122
|
+
part: "cloud",
|
|
123
|
+
recipe: nebulaCloudWideRecipe,
|
|
124
|
+
required: true
|
|
125
|
+
},
|
|
126
|
+
footer: {
|
|
127
|
+
part: "footer",
|
|
128
|
+
recipe: dialogFooterRecipe,
|
|
129
|
+
required: false
|
|
130
|
+
},
|
|
131
|
+
head: {
|
|
132
|
+
part: "head",
|
|
133
|
+
recipe: dialogHeadRecipe,
|
|
134
|
+
required: true
|
|
135
|
+
},
|
|
136
|
+
headings: {
|
|
137
|
+
part: "headings",
|
|
138
|
+
recipe: dialogHeadingsRecipe,
|
|
139
|
+
required: true
|
|
140
|
+
},
|
|
141
|
+
nebula: {
|
|
142
|
+
part: "nebula",
|
|
143
|
+
recipe: nebulaVeilRecipe,
|
|
144
|
+
required: true
|
|
145
|
+
},
|
|
146
|
+
root: {
|
|
147
|
+
part: "dialog",
|
|
148
|
+
recipe: dialogRecipe,
|
|
149
|
+
required: true
|
|
150
|
+
}
|
|
151
|
+
});
|
|
113
152
|
//#endregion
|
|
114
|
-
export { defaultDialogLayout, defaultDialogSize, dialogBackdropRecipe, dialogBodyRecipe, dialogCloseRecipe, dialogDescriptionRecipe, dialogFooterRecipe, dialogHeadRecipe, dialogHeadingsRecipe, dialogHeldRecipe, dialogLayouts, dialogNoteRecipe, dialogPositionerRecipe, dialogRecipe, dialogRowRecipe, dialogRowValueRecipe, dialogSizes, dialogTitleRecipe };
|
|
153
|
+
export { defaultDialogLayout, defaultDialogSize, dialogAnatomy, dialogBackdropRecipe, dialogBodyRecipe, dialogCloseRecipe, dialogDescriptionRecipe, dialogFooterRecipe, dialogHeadRecipe, dialogHeadingsRecipe, dialogHeldRecipe, dialogLayouts, dialogNoteRecipe, dialogPositionerRecipe, dialogRecipe, dialogRowRecipe, dialogRowValueRecipe, dialogSizes, dialogTitleRecipe };
|
|
115
154
|
|
|
116
155
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","names":[],"sources":["../../src/recipes/dialog.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { surfaceLifted, surfacePanel } from '#parts/surface'\n\nimport { liftMotion, scrimMirrorMotion } from './motion'\n\ntype DialogSize = 'sm' | 'md' | 'lg'\n\ntype DialogLayout = 'panel' | 'confirm'\n\nconst defaultDialogLayout = 'panel' satisfies DialogLayout\n\nconst dialogLayouts = ['panel', 'confirm'] as const satisfies readonly DialogLayout[]\n\nconst defaultDialogSize = 'md' satisfies DialogSize\n\nconst dialogSizes = ['sm', 'md', 'lg'] as const satisfies readonly DialogSize[]\n\nconst WIDTH = {\n lg: 'max-w-tf-page',\n md: 'max-w-tf-measure',\n sm: 'max-w-tf-panel',\n} satisfies Record<DialogSize, string>\n\nconst GROUND = 'relative bg-tf-shade-under'\n\nconst REGION = 'relative'\n\nconst FULL = [\n '@max-tf-panel:absolute @max-tf-panel:inset-0',\n '@max-tf-panel:max-h-none @max-tf-panel:max-w-none',\n '@max-tf-panel:rounded-tf-none',\n]\n\nconst dialogBackdropRecipe = cva([\n 'fixed inset-0 z-tf-modal bg-tf-scrim backdrop-blur-tf-scrim',\n ...scrimMirrorMotion,\n 'motion-reduce:animate-none',\n])\n\nconst dialogPositionerRecipe = cva([\n '@container fixed inset-0 z-tf-modal flex items-center justify-center p-4 sm:p-10',\n 'font-tf-body',\n])\n\nconst dialogRecipe = cva(\n [\n ...surfacePanel,\n 'tf-edge-plain',\n ...surfaceLifted,\n 'flex max-h-full w-full flex-col overflow-hidden outline-hidden',\n 'text-tf-body-sm font-medium text-tf-fg',\n ...FULL,\n ...liftMotion,\n 'motion-reduce:animate-none',\n ],\n {\n defaultVariants: { size: defaultDialogSize },\n variants: { size: WIDTH },\n },\n)\n\nconst dialogHeldRecipe = cva('motion-safe:data-[state=open]:data-held:tf-shaken')\n\nconst dialogHeadRecipe = cva([REGION, 'flex flex-none flex-col px-6 pt-8'], {\n defaultVariants: { layout: defaultDialogLayout },\n variants: {\n layout: {\n confirm: 'items-center gap-6 text-center',\n panel: 'gap-6 @max-tf-panel:pt-6',\n } satisfies Record<DialogLayout, string>,\n },\n})\n\nconst dialogHeadingsRecipe = cva('flex min-w-0 flex-none flex-col', {\n compoundVariants: [{ class: 'pr-12', layout: 'panel', roomy: true }],\n defaultVariants: { layout: defaultDialogLayout, roomy: false },\n variants: {\n layout: {\n confirm: 'items-center gap-3 text-center',\n panel: 'gap-2 pb-2',\n } satisfies Record<DialogLayout, string>,\n roomy: { false: '', true: '' },\n },\n})\n\nconst dialogTitleRecipe = cva('font-tf-display text-tf-h4 font-bold tracking-tf-tight text-tf-fg')\n\nconst dialogDescriptionRecipe = cva('text-tf-body-sm font-medium text-tf-muted')\n\nconst dialogCloseRecipe = cva('absolute top-3 right-3 z-tf-raised')\n\nconst FADED = [\n 'tf-scroll-faded tf-scroll-thin',\n '[--tf-fade-head:calc(var(--spacing)*6)] [--tf-fade-foot:calc(var(--spacing)*8)]',\n 'outline-hidden focused:outline-2 focused:-outline-offset-2 focused:outline-tf-accent-hi',\n].join(' ')\n\nconst dialogBodyRecipe = cva(\n [REGION, 'flex min-h-0 flex-col overflow-y-auto px-6 pt-6', FADED, '@max-tf-panel:flex-1'],\n {\n defaultVariants: { layout: defaultDialogLayout },\n variants: {\n layout: {\n confirm: 'items-center gap-6 pb-0 text-center',\n panel: 'gap-6 pb-8 @max-tf-panel:pb-6',\n } satisfies Record<DialogLayout, string>,\n },\n },\n)\n\nconst dialogFooterRecipe = cva(\n ['flex flex-none gap-3 rounded-b-tf-card px-6', '@max-tf-panel:rounded-tf-none'],\n {\n defaultVariants: { layout: defaultDialogLayout },\n variants: {\n layout: {\n confirm: `${REGION} flex-nowrap items-center pt-6 pb-6 *:flex-1`,\n panel: [\n GROUND,\n 'flex-wrap items-center justify-end py-5',\n '@max-tf-panel:flex-col-reverse @max-tf-panel:flex-nowrap @max-tf-panel:*:w-full',\n ].join(' '),\n } satisfies Record<DialogLayout, string>,\n },\n },\n)\n\nconst dialogNoteRecipe = cva('mr-auto text-tf-caption font-medium text-tf-muted tabular-nums')\n\nconst dialogRowRecipe = cva([\n 'flex h-tf-row flex-none items-center justify-between gap-3',\n 'rounded-tf-inline px-3 text-tf-muted',\n])\n\nconst dialogRowValueRecipe = cva('text-tf-fg tabular-nums', {\n defaultVariants: { lit: false },\n variants: {\n lit: { false: '', true: 'text-tf-accent-hi' },\n },\n})\n\nexport {\n type DialogLayout,\n type DialogSize,\n defaultDialogLayout,\n defaultDialogSize,\n dialogLayouts,\n dialogBackdropRecipe,\n dialogBodyRecipe,\n dialogCloseRecipe,\n dialogDescriptionRecipe,\n dialogFooterRecipe,\n dialogHeadRecipe,\n dialogHeadingsRecipe,\n dialogHeldRecipe,\n dialogNoteRecipe,\n dialogPositionerRecipe,\n dialogRecipe,\n dialogRowRecipe,\n dialogRowValueRecipe,\n dialogSizes,\n dialogTitleRecipe,\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dialog.js","names":[],"sources":["../../src/recipes/dialog.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\nimport { surfaceLifted, surfacePanel } from '#parts/surface'\n\nimport { liftMotion, scrimMirrorMotion } from './motion'\nimport { nebulaCloudWideRecipe, nebulaVeilRecipe } from './nebula'\n\ntype DialogSize = 'sm' | 'md' | 'lg'\n\ntype DialogLayout = 'panel' | 'confirm'\n\nconst defaultDialogLayout = 'panel' satisfies DialogLayout\n\nconst dialogLayouts = ['panel', 'confirm'] as const satisfies readonly DialogLayout[]\n\nconst defaultDialogSize = 'md' satisfies DialogSize\n\nconst dialogSizes = ['sm', 'md', 'lg'] as const satisfies readonly DialogSize[]\n\nconst WIDTH = {\n lg: 'max-w-tf-page',\n md: 'max-w-tf-measure',\n sm: 'max-w-tf-panel',\n} satisfies Record<DialogSize, string>\n\nconst GROUND = 'relative bg-tf-shade-under'\n\nconst REGION = 'relative'\n\nconst FULL = [\n '@max-tf-panel:absolute @max-tf-panel:inset-0',\n '@max-tf-panel:max-h-none @max-tf-panel:max-w-none',\n '@max-tf-panel:rounded-tf-none',\n]\n\nconst dialogBackdropRecipe = cva([\n 'fixed inset-0 z-tf-modal bg-tf-scrim backdrop-blur-tf-scrim',\n ...scrimMirrorMotion,\n 'motion-reduce:animate-none',\n])\n\nconst dialogPositionerRecipe = cva([\n '@container fixed inset-0 z-tf-modal flex items-center justify-center p-4 sm:p-10',\n 'font-tf-body',\n])\n\nconst dialogRecipe = cva(\n [\n ...surfacePanel,\n 'tf-edge-plain',\n ...surfaceLifted,\n 'flex max-h-full w-full flex-col overflow-hidden outline-hidden',\n 'text-tf-body-sm font-medium text-tf-fg',\n ...FULL,\n ...liftMotion,\n 'motion-reduce:animate-none',\n ],\n {\n defaultVariants: { size: defaultDialogSize },\n variants: { size: WIDTH },\n },\n)\n\nconst dialogHeldRecipe = cva('motion-safe:data-[state=open]:data-held:tf-shaken')\n\nconst dialogHeadRecipe = cva([REGION, 'flex flex-none flex-col px-6 pt-8'], {\n defaultVariants: { layout: defaultDialogLayout },\n variants: {\n layout: {\n confirm: 'items-center gap-6 text-center',\n panel: 'gap-6 @max-tf-panel:pt-6',\n } satisfies Record<DialogLayout, string>,\n },\n})\n\nconst dialogHeadingsRecipe = cva('flex min-w-0 flex-none flex-col', {\n compoundVariants: [{ class: 'pr-12', layout: 'panel', roomy: true }],\n defaultVariants: { layout: defaultDialogLayout, roomy: false },\n variants: {\n layout: {\n confirm: 'items-center gap-3 text-center',\n panel: 'gap-2 pb-2',\n } satisfies Record<DialogLayout, string>,\n roomy: { false: '', true: '' },\n },\n})\n\nconst dialogTitleRecipe = cva('font-tf-display text-tf-h4 font-bold tracking-tf-tight text-tf-fg')\n\nconst dialogDescriptionRecipe = cva('text-tf-body-sm font-medium text-tf-muted')\n\nconst dialogCloseRecipe = cva('absolute top-3 right-3 z-tf-raised')\n\nconst FADED = [\n 'tf-scroll-faded tf-scroll-thin',\n '[--tf-fade-head:calc(var(--spacing)*6)] [--tf-fade-foot:calc(var(--spacing)*8)]',\n 'outline-hidden focused:outline-2 focused:-outline-offset-2 focused:outline-tf-accent-hi',\n].join(' ')\n\nconst dialogBodyRecipe = cva(\n [REGION, 'flex min-h-0 flex-col overflow-y-auto px-6 pt-6', FADED, '@max-tf-panel:flex-1'],\n {\n defaultVariants: { layout: defaultDialogLayout },\n variants: {\n layout: {\n confirm: 'items-center gap-6 pb-0 text-center',\n panel: 'gap-6 pb-8 @max-tf-panel:pb-6',\n } satisfies Record<DialogLayout, string>,\n },\n },\n)\n\nconst dialogFooterRecipe = cva(\n ['flex flex-none gap-3 rounded-b-tf-card px-6', '@max-tf-panel:rounded-tf-none'],\n {\n defaultVariants: { layout: defaultDialogLayout },\n variants: {\n layout: {\n confirm: `${REGION} flex-nowrap items-center pt-6 pb-6 *:flex-1`,\n panel: [\n GROUND,\n 'flex-wrap items-center justify-end py-5',\n '@max-tf-panel:flex-col-reverse @max-tf-panel:flex-nowrap @max-tf-panel:*:w-full',\n ].join(' '),\n } satisfies Record<DialogLayout, string>,\n },\n },\n)\n\nconst dialogNoteRecipe = cva('mr-auto text-tf-caption font-medium text-tf-muted tabular-nums')\n\nconst dialogRowRecipe = cva([\n 'flex h-tf-row flex-none items-center justify-between gap-3',\n 'rounded-tf-inline px-3 text-tf-muted',\n])\n\nconst dialogRowValueRecipe = cva('text-tf-fg tabular-nums', {\n defaultVariants: { lit: false },\n variants: {\n lit: { false: '', true: 'text-tf-accent-hi' },\n },\n})\n\nconst dialogAnatomy = anatomy({\n body: { part: 'body', recipe: dialogBodyRecipe, required: true },\n cloud: { part: 'cloud', recipe: nebulaCloudWideRecipe, required: true },\n footer: { part: 'footer', recipe: dialogFooterRecipe, required: false },\n head: { part: 'head', recipe: dialogHeadRecipe, required: true },\n headings: { part: 'headings', recipe: dialogHeadingsRecipe, required: true },\n nebula: { part: 'nebula', recipe: nebulaVeilRecipe, required: true },\n root: { part: 'dialog', recipe: dialogRecipe, required: true },\n})\n\nexport {\n type DialogLayout,\n type DialogSize,\n defaultDialogLayout,\n defaultDialogSize,\n dialogLayouts,\n dialogAnatomy,\n dialogBackdropRecipe,\n dialogBodyRecipe,\n dialogCloseRecipe,\n dialogDescriptionRecipe,\n dialogFooterRecipe,\n dialogHeadRecipe,\n dialogHeadingsRecipe,\n dialogHeldRecipe,\n dialogNoteRecipe,\n dialogPositionerRecipe,\n dialogRecipe,\n dialogRowRecipe,\n dialogRowValueRecipe,\n dialogSizes,\n dialogTitleRecipe,\n}\n"],"mappings":";;;;;;AAYA,MAAM,sBAAsB;AAE5B,MAAM,gBAAgB,CAAC,SAAS,SAAS;AAEzC,MAAM,oBAAoB;AAE1B,MAAM,cAAc;CAAC;CAAM;CAAM;AAAI;AAErC,MAAM,QAAQ;CACZ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,MAAM,SAAS;AAEf,MAAM,SAAS;AAEf,MAAM,OAAO;CACX;CACA;CACA;AACF;AAEA,MAAM,uBAAuB,IAAI;CAC/B;CACA,GAAG;CACH;AACF,CAAC;AAED,MAAM,yBAAyB,IAAI,CACjC,oFACA,cACF,CAAC;AAED,MAAM,eAAe,IACnB;CACE,GAAG;CACH;CACA,GAAG;CACH;CACA;CACA,GAAG;CACH,GAAG;CACH;AACF,GACA;CACE,iBAAiB,EAAE,MAAA,KAAwB;CAC3C,UAAU,EAAE,MAAM,MAAM;AAC1B,CACF;AAEA,MAAM,mBAAmB,IAAI,mDAAmD;AAEhF,MAAM,mBAAmB,IAAI,CAAC,QAAQ,mCAAmC,GAAG;CAC1E,iBAAiB,EAAE,QAAQ,oBAAoB;CAC/C,UAAU,EACR,QAAQ;EACN,SAAS;EACT,OAAO;CACT,EACF;AACF,CAAC;AAED,MAAM,uBAAuB,IAAI,mCAAmC;CAClE,kBAAkB,CAAC;EAAE,OAAO;EAAS,QAAQ;EAAS,OAAO;CAAK,CAAC;CACnE,iBAAiB;EAAE,QAAQ;EAAqB,OAAO;CAAM;CAC7D,UAAU;EACR,QAAQ;GACN,SAAS;GACT,OAAO;EACT;EACA,OAAO;GAAE,OAAO;GAAI,MAAM;EAAG;CAC/B;AACF,CAAC;AAED,MAAM,oBAAoB,IAAI,mEAAmE;AAEjG,MAAM,0BAA0B,IAAI,2CAA2C;AAE/E,MAAM,oBAAoB,IAAI,oCAAoC;AAElE,MAAM,QAAQ;CACZ;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;AAEV,MAAM,mBAAmB,IACvB;CAAC;CAAQ;CAAmD;CAAO;AAAsB,GACzF;CACE,iBAAiB,EAAE,QAAQ,oBAAoB;CAC/C,UAAU,EACR,QAAQ;EACN,SAAS;EACT,OAAO;CACT,EACF;AACF,CACF;AAEA,MAAM,qBAAqB,IACzB,CAAC,+CAA+C,+BAA+B,GAC/E;CACE,iBAAiB,EAAE,QAAQ,oBAAoB;CAC/C,UAAU,EACR,QAAQ;EACN,SAAS,GAAG,OAAO;EACnB,OAAO;GACL;GACA;GACA;EACF,CAAC,CAAC,KAAK,GAAG;CACZ,EACF;AACF,CACF;AAEA,MAAM,mBAAmB,IAAI,gEAAgE;AAE7F,MAAM,kBAAkB,IAAI,CAC1B,8DACA,sCACF,CAAC;AAED,MAAM,uBAAuB,IAAI,2BAA2B;CAC1D,iBAAiB,EAAE,KAAK,MAAM;CAC9B,UAAU,EACR,KAAK;EAAE,OAAO;EAAI,MAAM;CAAoB,EAC9C;AACF,CAAC;AAED,MAAM,gBAAgB,QAAQ;CAC5B,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAkB,UAAU;CAAK;CAC/D,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAuB,UAAU;CAAK;CACtE,QAAQ;EAAE,MAAM;EAAU,QAAQ;EAAoB,UAAU;CAAM;CACtE,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAkB,UAAU;CAAK;CAC/D,UAAU;EAAE,MAAM;EAAY,QAAQ;EAAsB,UAAU;CAAK;CAC3E,QAAQ;EAAE,MAAM;EAAU,QAAQ;EAAkB,UAAU;CAAK;CACnE,MAAM;EAAE,MAAM;EAAU,QAAQ;EAAc,UAAU;CAAK;AAC/D,CAAC"}
|
|
@@ -10,6 +10,35 @@ declare const featureTitleRecipe: (props?: import("class-variance-authority/type
|
|
|
10
10
|
declare const featureLinkRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
11
11
|
declare const featureBodyRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
12
12
|
declare const featureFootRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
13
|
+
declare const featureAnatomy: {
|
|
14
|
+
readonly action: {
|
|
15
|
+
readonly part: "action";
|
|
16
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
17
|
+
readonly required: false;
|
|
18
|
+
};
|
|
19
|
+
readonly description: {
|
|
20
|
+
readonly part: "description";
|
|
21
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
22
|
+
readonly required: false;
|
|
23
|
+
};
|
|
24
|
+
readonly link: {
|
|
25
|
+
readonly part: "link";
|
|
26
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
27
|
+
readonly required: false;
|
|
28
|
+
};
|
|
29
|
+
readonly root: {
|
|
30
|
+
readonly part: "feature";
|
|
31
|
+
readonly recipe: (props?: ({
|
|
32
|
+
interactive?: boolean | null | undefined;
|
|
33
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
34
|
+
readonly required: true;
|
|
35
|
+
};
|
|
36
|
+
readonly title: {
|
|
37
|
+
readonly part: "title";
|
|
38
|
+
readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
39
|
+
readonly required: true;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
13
42
|
//#endregion
|
|
14
|
-
export { type FeatureLevel, defaultFeatureLevel, featureBodyRecipe, featureFootRecipe, featureLevels, featureLinkRecipe, featureRecipe, featureTileRecipe, featureTitleRecipe };
|
|
43
|
+
export { type FeatureLevel, defaultFeatureLevel, featureAnatomy, featureBodyRecipe, featureFootRecipe, featureLevels, featureLinkRecipe, featureRecipe, featureTileRecipe, featureTitleRecipe };
|
|
15
44
|
//# sourceMappingURL=feature.d.ts.map
|
package/dist/recipes/feature.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { anatomy } from "../anatomy.js";
|
|
2
2
|
import { tileReached, tileRoused } from "../parts/rouse.js";
|
|
3
|
+
import { surfacePanel } from "../parts/surface.js";
|
|
3
4
|
import { cva } from "class-variance-authority";
|
|
4
5
|
//#region src/recipes/feature.ts
|
|
5
6
|
const featureLevels = [
|
|
@@ -42,7 +43,34 @@ const featureFootRecipe = cva([
|
|
|
42
43
|
"[&_svg]:size-tf-icon-sm [&_svg]:tf-nudge-follow",
|
|
43
44
|
"pointer-events-none [&_a]:pointer-events-auto [&_button]:pointer-events-auto"
|
|
44
45
|
]);
|
|
46
|
+
const featureAnatomy = anatomy({
|
|
47
|
+
action: {
|
|
48
|
+
part: "action",
|
|
49
|
+
recipe: featureFootRecipe,
|
|
50
|
+
required: false
|
|
51
|
+
},
|
|
52
|
+
description: {
|
|
53
|
+
part: "description",
|
|
54
|
+
recipe: featureBodyRecipe,
|
|
55
|
+
required: false
|
|
56
|
+
},
|
|
57
|
+
link: {
|
|
58
|
+
part: "link",
|
|
59
|
+
recipe: featureLinkRecipe,
|
|
60
|
+
required: false
|
|
61
|
+
},
|
|
62
|
+
root: {
|
|
63
|
+
part: "feature",
|
|
64
|
+
recipe: featureRecipe,
|
|
65
|
+
required: true
|
|
66
|
+
},
|
|
67
|
+
title: {
|
|
68
|
+
part: "title",
|
|
69
|
+
recipe: featureTitleRecipe,
|
|
70
|
+
required: true
|
|
71
|
+
}
|
|
72
|
+
});
|
|
45
73
|
//#endregion
|
|
46
|
-
export { defaultFeatureLevel, featureBodyRecipe, featureFootRecipe, featureLevels, featureLinkRecipe, featureRecipe, featureTileRecipe, featureTitleRecipe };
|
|
74
|
+
export { defaultFeatureLevel, featureAnatomy, featureBodyRecipe, featureFootRecipe, featureLevels, featureLinkRecipe, featureRecipe, featureTileRecipe, featureTitleRecipe };
|
|
47
75
|
|
|
48
76
|
//# sourceMappingURL=feature.js.map
|