@joanroucoux/cairn-ui 0.8.2 → 0.9.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/CHANGELOG.md +99 -0
- package/fesm2022/joanroucoux-cairn-ui-action-bar.mjs +57 -53
- package/fesm2022/joanroucoux-cairn-ui-action-bar.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-alert.mjs +155 -47
- package/fesm2022/joanroucoux-cairn-ui-alert.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-amount.mjs +220 -110
- package/fesm2022/joanroucoux-cairn-ui-amount.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-async.mjs +392 -216
- package/fesm2022/joanroucoux-cairn-ui-async.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-avatar.mjs +145 -68
- package/fesm2022/joanroucoux-cairn-ui-avatar.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-back-link.mjs +87 -47
- package/fesm2022/joanroucoux-cairn-ui-back-link.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-badge.mjs +83 -43
- package/fesm2022/joanroucoux-cairn-ui-badge.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-button.mjs +184 -104
- package/fesm2022/joanroucoux-cairn-ui-button.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-card.mjs +232 -137
- package/fesm2022/joanroucoux-cairn-ui-card.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-choice-chips.mjs +298 -102
- package/fesm2022/joanroucoux-cairn-ui-choice-chips.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-control.mjs +4 -17
- package/fesm2022/joanroucoux-cairn-ui-control.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-delta.mjs +150 -83
- package/fesm2022/joanroucoux-cairn-ui-delta.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-dialog.mjs +508 -471
- package/fesm2022/joanroucoux-cairn-ui-dialog.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-donut.mjs +255 -157
- package/fesm2022/joanroucoux-cairn-ui-donut.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-drawer.mjs +303 -0
- package/fesm2022/joanroucoux-cairn-ui-drawer.mjs.map +1 -0
- package/fesm2022/joanroucoux-cairn-ui-empty.mjs +76 -35
- package/fesm2022/joanroucoux-cairn-ui-empty.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-external-link.mjs +40 -31
- package/fesm2022/joanroucoux-cairn-ui-external-link.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-fact.mjs +188 -79
- package/fesm2022/joanroucoux-cairn-ui-fact.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-field.mjs +309 -173
- package/fesm2022/joanroucoux-cairn-ui-field.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-filter-chips.mjs +165 -87
- package/fesm2022/joanroucoux-cairn-ui-filter-chips.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-group-header.mjs +269 -0
- package/fesm2022/joanroucoux-cairn-ui-group-header.mjs.map +1 -0
- package/fesm2022/joanroucoux-cairn-ui-input.mjs +205 -85
- package/fesm2022/joanroucoux-cairn-ui-input.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-line-chart.mjs +838 -512
- package/fesm2022/joanroucoux-cairn-ui-line-chart.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-menu.mjs +401 -225
- package/fesm2022/joanroucoux-cairn-ui-menu.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-meter.mjs +143 -57
- package/fesm2022/joanroucoux-cairn-ui-meter.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-motion.mjs +367 -399
- package/fesm2022/joanroucoux-cairn-ui-motion.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-nav-item.mjs +73 -44
- package/fesm2022/joanroucoux-cairn-ui-nav-item.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-result-group.mjs +191 -0
- package/fesm2022/joanroucoux-cairn-ui-result-group.mjs.map +1 -0
- package/fesm2022/joanroucoux-cairn-ui-row.mjs +376 -146
- package/fesm2022/joanroucoux-cairn-ui-row.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-segmented.mjs +183 -81
- package/fesm2022/joanroucoux-cairn-ui-segmented.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-select-pill.mjs +233 -0
- package/fesm2022/joanroucoux-cairn-ui-select-pill.mjs.map +1 -0
- package/fesm2022/joanroucoux-cairn-ui-select.mjs +121 -67
- package/fesm2022/joanroucoux-cairn-ui-select.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-skeleton.mjs +129 -51
- package/fesm2022/joanroucoux-cairn-ui-skeleton.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-stale-link.mjs +80 -39
- package/fesm2022/joanroucoux-cairn-ui-stale-link.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-stat.mjs +85 -55
- package/fesm2022/joanroucoux-cairn-ui-stat.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-switch.mjs +48 -35
- package/fesm2022/joanroucoux-cairn-ui-switch.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-tab-bar.mjs +113 -69
- package/fesm2022/joanroucoux-cairn-ui-tab-bar.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-table.mjs +1036 -310
- package/fesm2022/joanroucoux-cairn-ui-table.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui-toast.mjs +240 -127
- package/fesm2022/joanroucoux-cairn-ui-toast.mjs.map +1 -1
- package/fesm2022/joanroucoux-cairn-ui.mjs +0 -4
- package/package.json +17 -1
- package/styles/motion.css +1 -13
- package/styles/tokens.css +35 -64
- package/types/joanroucoux-cairn-ui-action-bar.d.ts +9 -14
- package/types/joanroucoux-cairn-ui-alert.d.ts +29 -15
- package/types/joanroucoux-cairn-ui-amount.d.ts +64 -32
- package/types/joanroucoux-cairn-ui-async.d.ts +85 -38
- package/types/joanroucoux-cairn-ui-avatar.d.ts +34 -22
- package/types/joanroucoux-cairn-ui-back-link.d.ts +20 -15
- package/types/joanroucoux-cairn-ui-badge.d.ts +22 -14
- package/types/joanroucoux-cairn-ui-button.d.ts +36 -18
- package/types/joanroucoux-cairn-ui-card.d.ts +48 -23
- package/types/joanroucoux-cairn-ui-choice-chips.d.ts +91 -35
- package/types/joanroucoux-cairn-ui-control.d.ts +9 -18
- package/types/joanroucoux-cairn-ui-delta.d.ts +46 -24
- package/types/joanroucoux-cairn-ui-dialog.d.ts +124 -57
- package/types/joanroucoux-cairn-ui-donut.d.ts +83 -46
- package/types/joanroucoux-cairn-ui-drawer.d.ts +73 -0
- package/types/joanroucoux-cairn-ui-empty.d.ts +20 -13
- package/types/joanroucoux-cairn-ui-external-link.d.ts +6 -10
- package/types/joanroucoux-cairn-ui-fact.d.ts +49 -25
- package/types/joanroucoux-cairn-ui-field.d.ts +72 -49
- package/types/joanroucoux-cairn-ui-filter-chips.d.ts +35 -20
- package/types/joanroucoux-cairn-ui-group-header.d.ts +58 -0
- package/types/joanroucoux-cairn-ui-input.d.ts +59 -37
- package/types/joanroucoux-cairn-ui-line-chart.d.ts +199 -89
- package/types/joanroucoux-cairn-ui-menu.d.ts +81 -44
- package/types/joanroucoux-cairn-ui-meter.d.ts +44 -22
- package/types/joanroucoux-cairn-ui-motion.d.ts +61 -75
- package/types/joanroucoux-cairn-ui-nav-item.d.ts +15 -13
- package/types/joanroucoux-cairn-ui-result-group.d.ts +52 -0
- package/types/joanroucoux-cairn-ui-row.d.ts +79 -37
- package/types/joanroucoux-cairn-ui-segmented.d.ts +51 -27
- package/types/joanroucoux-cairn-ui-select-pill.d.ts +52 -0
- package/types/joanroucoux-cairn-ui-select.d.ts +28 -18
- package/types/joanroucoux-cairn-ui-skeleton.d.ts +35 -18
- package/types/joanroucoux-cairn-ui-stale-link.d.ts +23 -16
- package/types/joanroucoux-cairn-ui-stat.d.ts +26 -21
- package/types/joanroucoux-cairn-ui-switch.d.ts +7 -11
- package/types/joanroucoux-cairn-ui-tab-bar.d.ts +20 -17
- package/types/joanroucoux-cairn-ui-table.d.ts +251 -89
- package/types/joanroucoux-cairn-ui-toast.d.ts +46 -36
- package/types/joanroucoux-cairn-ui.d.ts +1 -2
- package/fesm2022/joanroucoux-cairn-ui.mjs.map +0 -1
|
@@ -1,48 +1,56 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
/** Available stat sizes. `StatSize` is derived from this tuple. */
|
|
5
|
-
const STAT_SIZES = ['hero', 'tile'];
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, computed, input } from "@angular/core";
|
|
3
|
+
const STAT_SIZES = ["hero", "tile"];
|
|
6
4
|
const VALUE_CLASSES = {
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
hero: "text-display font-semibold tracking-(--tracking-display) text-(--foreground)",
|
|
6
|
+
tile: "text-title font-semibold tabular-nums text-(--foreground)"
|
|
9
7
|
};
|
|
10
8
|
const LABEL_CLASSES = {
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
hero: "text-label font-medium text-(--muted-foreground)",
|
|
10
|
+
tile: "text-label font-normal text-(--muted-foreground)"
|
|
13
11
|
};
|
|
14
12
|
const STACK_CLASSES = {
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
hero: "flex flex-col gap-1",
|
|
14
|
+
tile: "flex flex-col gap-0.5"
|
|
17
15
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
16
|
+
var UiStat = class UiStat {
|
|
17
|
+
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
18
|
+
size = input("tile", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
19
|
+
labelClasses = computed(() => LABEL_CLASSES[this.size()], ...ngDevMode ? [{ debugName: "labelClasses" }] : /* istanbul ignore next */ []);
|
|
20
|
+
stackClasses = computed(() => STACK_CLASSES[this.size()], ...ngDevMode ? [{ debugName: "stackClasses" }] : /* istanbul ignore next */ []);
|
|
21
|
+
valueClasses = computed(() => VALUE_CLASSES[this.size()], ...ngDevMode ? [{ debugName: "valueClasses" }] : /* istanbul ignore next */ []);
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
23
|
+
minVersion: "12.0.0",
|
|
24
|
+
version: "22.2.0",
|
|
25
|
+
ngImport: i0,
|
|
26
|
+
type: UiStat,
|
|
27
|
+
deps: [],
|
|
28
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
29
|
+
});
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
31
|
+
minVersion: "17.1.0",
|
|
32
|
+
version: "22.2.0",
|
|
33
|
+
type: UiStat,
|
|
34
|
+
isStandalone: true,
|
|
35
|
+
selector: "ui-stat",
|
|
36
|
+
inputs: {
|
|
37
|
+
label: {
|
|
38
|
+
classPropertyName: "label",
|
|
39
|
+
publicName: "label",
|
|
40
|
+
isSignal: true,
|
|
41
|
+
isRequired: true,
|
|
42
|
+
transformFunction: null
|
|
43
|
+
},
|
|
44
|
+
size: {
|
|
45
|
+
classPropertyName: "size",
|
|
46
|
+
publicName: "size",
|
|
47
|
+
isSignal: true,
|
|
48
|
+
isRequired: false,
|
|
49
|
+
transformFunction: null
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
ngImport: i0,
|
|
53
|
+
template: `
|
|
46
54
|
<div class="flex items-start justify-between gap-4">
|
|
47
55
|
<div [class]="stackClasses()">
|
|
48
56
|
<dl [class]="stackClasses()">
|
|
@@ -60,13 +68,20 @@ class UiStat {
|
|
|
60
68
|
|
|
61
69
|
<ng-content select="[uiStatAside]" />
|
|
62
70
|
</div>
|
|
63
|
-
`,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
`,
|
|
72
|
+
isInline: true
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
76
|
+
minVersion: "12.0.0",
|
|
77
|
+
version: "22.2.0",
|
|
78
|
+
ngImport: i0,
|
|
79
|
+
type: UiStat,
|
|
80
|
+
decorators: [{
|
|
81
|
+
type: Component,
|
|
82
|
+
args: [{
|
|
83
|
+
selector: "ui-stat",
|
|
84
|
+
template: `
|
|
70
85
|
<div class="flex items-start justify-between gap-4">
|
|
71
86
|
<div [class]="stackClasses()">
|
|
72
87
|
<dl [class]="stackClasses()">
|
|
@@ -84,13 +99,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
84
99
|
|
|
85
100
|
<ng-content select="[uiStatAside]" />
|
|
86
101
|
</div>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
102
|
+
`
|
|
103
|
+
}]
|
|
104
|
+
}],
|
|
105
|
+
propDecorators: {
|
|
106
|
+
label: [{
|
|
107
|
+
type: i0.Input,
|
|
108
|
+
args: [{
|
|
109
|
+
isSignal: true,
|
|
110
|
+
alias: "label",
|
|
111
|
+
required: true
|
|
112
|
+
}]
|
|
113
|
+
}],
|
|
114
|
+
size: [{
|
|
115
|
+
type: i0.Input,
|
|
116
|
+
args: [{
|
|
117
|
+
isSignal: true,
|
|
118
|
+
alias: "size",
|
|
119
|
+
required: false
|
|
120
|
+
}]
|
|
121
|
+
}]
|
|
122
|
+
}
|
|
123
|
+
});
|
|
95
124
|
export { STAT_SIZES, UiStat };
|
|
96
|
-
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=joanroucoux-cairn-ui-stat.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joanroucoux-cairn-ui-stat.mjs","
|
|
1
|
+
{"version":3,"file":"joanroucoux-cairn-ui-stat.mjs","names":[],"sources":["../../../projects/ui/stat/stat.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\n\n/** Available stat sizes. */\nexport const STAT_SIZES = ['hero', 'tile'] as const;\nexport type StatSize = (typeof STAT_SIZES)[number];\n\nconst VALUE_CLASSES: Record<StatSize, string> = {\n hero: 'text-display font-semibold tracking-(--tracking-display) text-(--foreground)',\n tile: 'text-title font-semibold tabular-nums text-(--foreground)',\n};\n\nconst LABEL_CLASSES: Record<StatSize, string> = {\n hero: 'text-label font-medium text-(--muted-foreground)',\n tile: 'text-label font-normal text-(--muted-foreground)',\n};\n\nconst STACK_CLASSES: Record<StatSize, string> = {\n hero: 'flex flex-col gap-1',\n tile: 'flex flex-col gap-0.5',\n};\n\n/**\n * Label, figure and a named period of change: a `hero` for a screen's single headline number, or a\n * smaller `tile` repeated in a grid. The figure, its delta and its caption are projected, so the\n * component does no formatting. The `hero` figure does not use `tabular-nums`.\n *\n * @example\n * <ui-stat label=\"Net worth\" size=\"hero\">\n * <span uiStatValue>128,656 EUR</span>\n * <ui-delta uiStatDelta [value]=\"dayChange()\" unknownLabel=\"Not available\">+316.54 EUR</ui-delta>\n * <span uiStatCaption>today</span>\n * </ui-stat>\n */\n@Component({\n selector: 'ui-stat',\n template: `\n <div class=\"flex items-start justify-between gap-4\">\n <div [class]=\"stackClasses()\">\n <dl [class]=\"stackClasses()\">\n <dt [class]=\"labelClasses()\">{{ label() }}</dt>\n <dd [class]=\"valueClasses()\">\n <ng-content select=\"[uiStatValue]\" />\n </dd>\n </dl>\n\n <div class=\"text-label flex flex-wrap items-center gap-x-1.5 gap-y-1 text-(--muted-foreground)\">\n <ng-content select=\"[uiStatDelta]\" />\n <ng-content select=\"[uiStatCaption]\" />\n </div>\n </div>\n\n <ng-content select=\"[uiStatAside]\" />\n </div>\n `,\n})\nexport class UiStat {\n readonly label = input.required<string>();\n readonly size = input<StatSize>('tile');\n\n protected readonly labelClasses = computed(() => LABEL_CLASSES[this.size()]);\n\n protected readonly stackClasses = computed(() => STACK_CLASSES[this.size()]);\n\n protected readonly valueClasses = computed(() => VALUE_CLASSES[this.size()]);\n}\n"],"mappings":";;AAGA,MAAa,aAAa,CAAC,QAAQ,MAAM;AAGzC,MAAM,gBAA0C;CAC9C,MAAM;CACN,MAAM;AACP;AAED,MAAM,gBAA0C;CAC9C,MAAM;CACN,MAAM;AACP;AAED,MAAM,gBAA0C;CAC9C,MAAM;CACN,MAAM;AACP;AAoCD,IAAa,SAAb,MAAa,OAAM;CACR,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,OAAO,MAAgB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAEpB,eAAe,eAAe,cAAc,KAAK,KAAI,IAAI,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAEzD,eAAe,eAAe,cAAc,KAAK,KAAI,IAAI,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAEzD,eAAe,eAAe,cAAc,KAAK,KAAI,IAAI,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CARjE,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAM,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAN,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAM,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,UAAA;EAAA,UApBP;;;;;;;;;;;;;;;;;;;EAkBT,UAAA;CAAA,CAAA;;AAEU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAM,YAAA,CAAA;EAtBlB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;;;;;;;;;;;;;;;;;;;EAmBX,CAAA"}
|
|
@@ -1,37 +1,50 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Directive } from
|
|
3
|
-
import { holdTransitionsUntilRendered } from
|
|
4
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Directive } from "@angular/core";
|
|
3
|
+
import { holdTransitionsUntilRendered } from "@joanroucoux/cairn-ui/motion";
|
|
5
4
|
const CLASSES = "relative shrink-0 w-[51px] h-[31px] pointer-fine:w-10 pointer-fine:h-6 appearance-none cursor-pointer rounded-pill bg-(--muted) checked:bg-(--primary) transition-[background-color] duration-(--duration-fast) ease-out disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:-translate-y-1/2 before:h-(--row-min) before:content-[''] after:absolute after:top-0.5 after:left-0.5 after:size-[27px] pointer-fine:after:size-5 after:rounded-pill after:bg-(--card) after:shadow-[0_1px_3px_rgb(0_0_0/0.2)] after:transition-transform after:duration-(--duration-fast) after:ease-out after:content-[''] checked:after:translate-x-[20px] pointer-fine:checked:after:translate-x-4";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
5
|
+
var UiSwitch = class UiSwitch {
|
|
6
|
+
classes = CLASSES;
|
|
7
|
+
constructor() {
|
|
8
|
+
holdTransitionsUntilRendered();
|
|
9
|
+
}
|
|
10
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
11
|
+
minVersion: "12.0.0",
|
|
12
|
+
version: "22.2.0",
|
|
13
|
+
ngImport: i0,
|
|
14
|
+
type: UiSwitch,
|
|
15
|
+
deps: [],
|
|
16
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
17
|
+
});
|
|
18
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
19
|
+
minVersion: "14.0.0",
|
|
20
|
+
version: "22.2.0",
|
|
21
|
+
type: UiSwitch,
|
|
22
|
+
isStandalone: true,
|
|
23
|
+
selector: "input[type=checkbox][uiSwitch]",
|
|
24
|
+
host: {
|
|
25
|
+
attributes: { "role": "switch" },
|
|
26
|
+
properties: { "class": "classes" }
|
|
27
|
+
},
|
|
28
|
+
ngImport: i0
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
32
|
+
minVersion: "12.0.0",
|
|
33
|
+
version: "22.2.0",
|
|
34
|
+
ngImport: i0,
|
|
35
|
+
type: UiSwitch,
|
|
36
|
+
decorators: [{
|
|
37
|
+
type: Directive,
|
|
38
|
+
args: [{
|
|
39
|
+
selector: "input[type=checkbox][uiSwitch]",
|
|
40
|
+
host: {
|
|
41
|
+
role: "switch",
|
|
42
|
+
"[class]": "classes"
|
|
43
|
+
}
|
|
44
|
+
}]
|
|
45
|
+
}],
|
|
46
|
+
ctorParameters: () => []
|
|
47
|
+
});
|
|
36
48
|
export { UiSwitch };
|
|
37
|
-
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=joanroucoux-cairn-ui-switch.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joanroucoux-cairn-ui-switch.mjs","
|
|
1
|
+
{"version":3,"file":"joanroucoux-cairn-ui-switch.mjs","names":[],"sources":["../../../projects/ui/switch/switch.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\nimport { holdTransitionsUntilRendered } from '@joanroucoux/cairn-ui/motion';\n\nconst CLASSES =\n \"relative shrink-0 w-[51px] h-[31px] pointer-fine:w-10 pointer-fine:h-6 appearance-none cursor-pointer rounded-pill bg-(--muted) checked:bg-(--primary) transition-[background-color] duration-(--duration-fast) ease-out disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:-translate-y-1/2 before:h-(--row-min) before:content-[''] after:absolute after:top-0.5 after:left-0.5 after:size-[27px] pointer-fine:after:size-5 after:rounded-pill after:bg-(--card) after:shadow-[0_1px_3px_rgb(0_0_0/0.2)] after:transition-transform after:duration-(--duration-fast) after:ease-out after:content-[''] checked:after:translate-x-[20px] pointer-fine:checked:after:translate-x-4\";\n\n/**\n * Native checkbox styled as an iOS-style switch, exposed to assistive technology as `role=\"switch\"`.\n *\n * @example\n * <input type=\"checkbox\" uiSwitch [checked]=\"hidden()\" (change)=\"toggle()\" aria-label=\"Hide amounts\" />\n */\n@Directive({\n selector: 'input[type=checkbox][uiSwitch]',\n host: {\n role: 'switch',\n '[class]': 'classes',\n },\n})\nexport class UiSwitch {\n protected readonly classes = CLASSES;\n\n constructor() {\n holdTransitionsUntilRendered();\n }\n}\n"],"mappings":";;;AAIA,MAAM,UACJ;AAeF,IAAa,WAAb,MAAa,SAAQ;CACA,UAAU;CAE7B,cAAA;EACE,6BAA4B;CAC9B;CALW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAQ,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAR,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAQ,cAAA;EAAA,UAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,SAAA;GAAA,YAAA,EAAA,SAAA,UAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAR,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EAPpB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM;IACJ,MAAM;IACN,WAAW;GACZ;EACF,CAAA"}
|
|
@@ -1,75 +1,119 @@
|
|
|
1
|
-
import { DOCUMENT } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
class
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
import { DOCUMENT } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Component, DestroyRef, booleanAttribute, computed, inject, input } from "@angular/core";
|
|
4
|
+
const HEIGHT_PROPERTY = "--tab-bar-height";
|
|
5
|
+
const HEIGHT = "calc(52px + env(safe-area-inset-bottom))";
|
|
6
|
+
const TAB_CLASSES = "flex h-[52px] flex-col items-center justify-center gap-[3px] touch-manipulation select-none transition-transform duration-(--duration-press) ease-out active:scale-(--press-scale) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--ring)";
|
|
7
|
+
const INACTIVE_TAB_CLASSES = "font-medium text-(--muted-foreground)";
|
|
8
|
+
const ACTIVE_TAB_CLASSES = "font-semibold text-(--foreground)";
|
|
9
|
+
var UiTabBar = class UiTabBar {
|
|
10
|
+
constructor() {
|
|
11
|
+
const root = inject(DOCUMENT).documentElement;
|
|
12
|
+
root.style.setProperty(HEIGHT_PROPERTY, HEIGHT);
|
|
13
|
+
inject(DestroyRef).onDestroy(() => root.style.removeProperty(HEIGHT_PROPERTY));
|
|
14
|
+
}
|
|
15
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
16
|
+
minVersion: "12.0.0",
|
|
17
|
+
version: "22.2.0",
|
|
18
|
+
ngImport: i0,
|
|
19
|
+
type: UiTabBar,
|
|
20
|
+
deps: [],
|
|
21
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
22
|
+
});
|
|
23
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
24
|
+
minVersion: "14.0.0",
|
|
25
|
+
version: "22.2.0",
|
|
26
|
+
type: UiTabBar,
|
|
27
|
+
isStandalone: true,
|
|
28
|
+
selector: "nav[ui-tab-bar]",
|
|
29
|
+
host: { classAttribute: "grid grid-flow-col auto-cols-fr items-stretch bg-(--background)/90 backdrop-blur [@media(prefers-reduced-transparency:reduce)]:bg-(--background) shadow-[inset_0_1px_0_var(--hairline)] pb-[env(safe-area-inset-bottom)]" },
|
|
30
|
+
ngImport: i0,
|
|
31
|
+
template: "<ng-content />",
|
|
32
|
+
isInline: true
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
36
|
+
minVersion: "12.0.0",
|
|
37
|
+
version: "22.2.0",
|
|
38
|
+
ngImport: i0,
|
|
39
|
+
type: UiTabBar,
|
|
40
|
+
decorators: [{
|
|
41
|
+
type: Component,
|
|
42
|
+
args: [{
|
|
43
|
+
selector: "nav[ui-tab-bar]",
|
|
44
|
+
template: "<ng-content />",
|
|
45
|
+
host: { class: "grid grid-flow-col auto-cols-fr items-stretch bg-(--background)/90 backdrop-blur [@media(prefers-reduced-transparency:reduce)]:bg-(--background) shadow-[inset_0_1px_0_var(--hairline)] pb-[env(safe-area-inset-bottom)]" }
|
|
46
|
+
}]
|
|
47
|
+
}],
|
|
48
|
+
ctorParameters: () => []
|
|
49
|
+
});
|
|
50
|
+
var UiTab = class UiTab {
|
|
51
|
+
active = input(false, {
|
|
52
|
+
...ngDevMode ? { debugName: "active" } : /* istanbul ignore next */ {},
|
|
53
|
+
transform: booleanAttribute
|
|
54
|
+
});
|
|
55
|
+
classes = computed(() => `${TAB_CLASSES} ${this.active() ? ACTIVE_TAB_CLASSES : INACTIVE_TAB_CLASSES}`, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
56
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
57
|
+
minVersion: "12.0.0",
|
|
58
|
+
version: "22.2.0",
|
|
59
|
+
ngImport: i0,
|
|
60
|
+
type: UiTab,
|
|
61
|
+
deps: [],
|
|
62
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
63
|
+
});
|
|
64
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
65
|
+
minVersion: "17.1.0",
|
|
66
|
+
version: "22.2.0",
|
|
67
|
+
type: UiTab,
|
|
68
|
+
isStandalone: true,
|
|
69
|
+
selector: "a[ui-tab]",
|
|
70
|
+
inputs: { active: {
|
|
71
|
+
classPropertyName: "active",
|
|
72
|
+
publicName: "active",
|
|
73
|
+
isSignal: true,
|
|
74
|
+
isRequired: false,
|
|
75
|
+
transformFunction: null
|
|
76
|
+
} },
|
|
77
|
+
host: { properties: {
|
|
78
|
+
"class": "classes()",
|
|
79
|
+
"attr.aria-current": "active() ? 'page' : null"
|
|
80
|
+
} },
|
|
81
|
+
ngImport: i0,
|
|
82
|
+
template: `
|
|
51
83
|
<span class="size-6" data-tab-icon><ng-content select="[tabIcon]" /></span>
|
|
52
84
|
<span class="text-caption leading-none" data-tab-label><ng-content /></span>
|
|
53
|
-
`,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
85
|
+
`,
|
|
86
|
+
isInline: true
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
90
|
+
minVersion: "12.0.0",
|
|
91
|
+
version: "22.2.0",
|
|
92
|
+
ngImport: i0,
|
|
93
|
+
type: UiTab,
|
|
94
|
+
decorators: [{
|
|
95
|
+
type: Component,
|
|
96
|
+
args: [{
|
|
97
|
+
selector: "a[ui-tab]",
|
|
98
|
+
template: `
|
|
60
99
|
<span class="size-6" data-tab-icon><ng-content select="[tabIcon]" /></span>
|
|
61
100
|
<span class="text-caption leading-none" data-tab-label><ng-content /></span>
|
|
62
101
|
`,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
102
|
+
host: {
|
|
103
|
+
"[class]": "classes()",
|
|
104
|
+
"[attr.aria-current]": "active() ? 'page' : null"
|
|
105
|
+
}
|
|
106
|
+
}]
|
|
107
|
+
}],
|
|
108
|
+
propDecorators: { active: [{
|
|
109
|
+
type: i0.Input,
|
|
110
|
+
args: [{
|
|
111
|
+
isSignal: true,
|
|
112
|
+
alias: "active",
|
|
113
|
+
required: false
|
|
114
|
+
}]
|
|
115
|
+
}] }
|
|
116
|
+
});
|
|
74
117
|
export { UiTab, UiTabBar };
|
|
75
|
-
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=joanroucoux-cairn-ui-tab-bar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joanroucoux-cairn-ui-tab-bar.mjs","
|
|
1
|
+
{"version":3,"file":"joanroucoux-cairn-ui-tab-bar.mjs","names":[],"sources":["../../../projects/ui/tab-bar/tab-bar.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { Component, DestroyRef, booleanAttribute, computed, inject, input } from '@angular/core';\n\nconst HEIGHT_PROPERTY = '--tab-bar-height';\n\nconst HEIGHT = 'calc(52px + env(safe-area-inset-bottom))';\n\nconst TAB_CLASSES =\n 'flex h-[52px] flex-col items-center justify-center gap-[3px] touch-manipulation select-none transition-transform duration-(--duration-press) ease-out active:scale-(--press-scale) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--ring)';\n\nconst INACTIVE_TAB_CLASSES = 'font-medium text-(--muted-foreground)';\n\nconst ACTIVE_TAB_CLASSES = 'font-semibold text-(--foreground)';\n\n/**\n * Bottom navigation bar for iPhone. While it is on the page it publishes its height as\n * `--tab-bar-height` on the root element, which `ui-action-bar` and `ui-toaster` sit above: use it\n * for anything else that must clear the bar.\n *\n * @example\n * <nav ui-tab-bar>\n * <a ui-tab [active]=\"url === '/'\" routerLink=\"/\"><lucide-icon tabIcon name=\"house\" />Portfolio</a>\n * </nav>\n */\n@Component({\n selector: 'nav[ui-tab-bar]',\n template: '<ng-content />',\n host: {\n class:\n 'grid grid-flow-col auto-cols-fr items-stretch bg-(--background)/90 backdrop-blur [@media(prefers-reduced-transparency:reduce)]:bg-(--background) shadow-[inset_0_1px_0_var(--hairline)] pb-[env(safe-area-inset-bottom)]',\n },\n})\nexport class UiTabBar {\n constructor() {\n const root = inject(DOCUMENT).documentElement;\n\n root.style.setProperty(HEIGHT_PROPERTY, HEIGHT);\n inject(DestroyRef).onDestroy(() => root.style.removeProperty(HEIGHT_PROPERTY));\n }\n}\n\n/**\n * One destination of `ui-tab-bar`.\n *\n * @example\n * <a ui-tab active routerLink=\"/\"><lucide-icon tabIcon name=\"house\" />Portfolio</a>\n */\n@Component({\n selector: 'a[ui-tab]',\n template: `\n <span class=\"size-6\" data-tab-icon><ng-content select=\"[tabIcon]\" /></span>\n <span class=\"text-caption leading-none\" data-tab-label><ng-content /></span>\n `,\n host: {\n '[class]': 'classes()',\n '[attr.aria-current]': \"active() ? 'page' : null\",\n },\n})\nexport class UiTab {\n readonly active = input(false, { transform: booleanAttribute });\n\n protected readonly classes = computed(\n () => `${TAB_CLASSES} ${this.active() ? ACTIVE_TAB_CLASSES : INACTIVE_TAB_CLASSES}`,\n );\n}\n"],"mappings":";;;AAGA,MAAM,kBAAkB;AAExB,MAAM,SAAS;AAEf,MAAM,cACJ;AAEF,MAAM,uBAAuB;AAE7B,MAAM,qBAAqB;AAoB3B,IAAa,WAAb,MAAa,SAAQ;CACnB,cAAA;EACE,MAAM,OAAO,OAAO,QAAQ,CAAC,CAAC;EAE9B,KAAK,MAAM,YAAY,iBAAiB,MAAM;EAC9C,OAAO,UAAU,CAAC,CAAC,gBAAgB,KAAK,MAAM,eAAe,eAAe,CAAC;CAC/E;CANW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAQ,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAR,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAQ,cAAA;EAAA,UAAA;EAAA,MAAA,EAAA,gBAAA,2NAAA;EAAA,UAAA;EAAA,UANT;EAAgB,UAAA;CAAA,CAAA;;AAMf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EARpB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,MAAM,EACJ,OACE,2NACH;EACF,CAAA;;;;AA2BD,IAAa,QAAb,MAAa,MAAK;CACP,SAAS,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAEzC,UAAU,eACrB,GAAG,YAAW,GAAI,KAAK,OAAM,IAAK,qBAAqB,wBAC9D,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CALU,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAK,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAL,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAK,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,QAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,YAAA;GAAA,SAAA;GAAA,qBAAA;EAAA,EAAA;EAAA,UAAA;EAAA,UATN;;;;EAGT,UAAA;CAAA,CAAA;;AAMU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAK,YAAA,CAAA;EAXjB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;;;;GAIV,MAAM;IACJ,WAAW;IACX,uBAAuB;GACxB;EACF,CAAA"}
|