@joanroucoux/cairn-ui 0.8.1 → 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 +105 -0
- package/README.md +2 -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,69 +1,123 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { UI_CONTROL } from
|
|
4
|
-
import { CONTROL_BASE_CLASSES, CONTROL_SIZE_CLASSES } from
|
|
5
|
-
|
|
6
|
-
const SELECT_CLASSES = 'cursor-pointer appearance-none pr-10 bg-(image:--chevron-down) bg-no-repeat bg-[position:right_0.75rem_center] bg-[size:1.125rem]';
|
|
7
|
-
// Spelled out prefix included: Tailwind scans for literal strings, so a prefix applied in code
|
|
8
|
-
// emits nothing.
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Directive, computed, forwardRef, input } from "@angular/core";
|
|
3
|
+
import { UI_CONTROL } from "@joanroucoux/cairn-ui/control";
|
|
4
|
+
import { CONTROL_BASE_CLASSES, CONTROL_SIZE_CLASSES } from "@joanroucoux/cairn-ui/input";
|
|
5
|
+
const SELECT_CLASSES = "cursor-pointer appearance-none pr-10 bg-(image:--chevron-down) bg-no-repeat bg-[position:right_0.75rem_center] bg-[size:1.125rem]";
|
|
9
6
|
const PICKER_CLASSES = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
].join(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
7
|
+
"pointer-fine:supports-[appearance:base-select]:[appearance:base-select]",
|
|
8
|
+
"pointer-fine:supports-[appearance:base-select]:items-center",
|
|
9
|
+
"pointer-fine:supports-[appearance:base-select]:[&_option]:cursor-pointer",
|
|
10
|
+
"pointer-fine:supports-[appearance:base-select]:[&_option]:rounded-control",
|
|
11
|
+
"pointer-fine:supports-[appearance:base-select]:[&_option]:px-2.5",
|
|
12
|
+
"pointer-fine:supports-[appearance:base-select]:[&_option]:py-2",
|
|
13
|
+
"pointer-fine:supports-[appearance:base-select]:[&_option:hover]:bg-(--soft)",
|
|
14
|
+
"pointer-fine:supports-[appearance:base-select]:[&_option:focus]:bg-(--soft)",
|
|
15
|
+
"pointer-fine:supports-[appearance:base-select]:[&_option:checked]:font-medium",
|
|
16
|
+
"[&::picker-icon]:hidden",
|
|
17
|
+
"[&::picker(select)]:[appearance:base-select]",
|
|
18
|
+
"[&::picker(select)]:my-1.5",
|
|
19
|
+
"[&::picker(select)]:rounded-control",
|
|
20
|
+
"[&::picker(select)]:border",
|
|
21
|
+
"[&::picker(select)]:border-(--border)",
|
|
22
|
+
"[&::picker(select)]:bg-(--card)",
|
|
23
|
+
"[&::picker(select)]:[position-try-fallbacks:none]",
|
|
24
|
+
"[&::picker(select)]:overflow-y-auto",
|
|
25
|
+
"[&::picker(select)]:p-1",
|
|
26
|
+
"[&::picker(select)]:text-(--card-foreground)"
|
|
27
|
+
].join(" ");
|
|
28
|
+
var UiSelect = class UiSelect {
|
|
29
|
+
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
30
|
+
errors = input([], ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
|
|
31
|
+
touched = input(false, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
|
|
32
|
+
classes = computed(() => `${CONTROL_BASE_CLASSES} bg-(--background) ${SELECT_CLASSES} ${PICKER_CLASSES} ${CONTROL_SIZE_CLASSES[this.size()]}`, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
34
|
+
minVersion: "12.0.0",
|
|
35
|
+
version: "22.2.0",
|
|
36
|
+
ngImport: i0,
|
|
37
|
+
type: UiSelect,
|
|
38
|
+
deps: [],
|
|
39
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
40
|
+
});
|
|
41
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
42
|
+
minVersion: "17.1.0",
|
|
43
|
+
version: "22.2.0",
|
|
44
|
+
type: UiSelect,
|
|
45
|
+
isStandalone: true,
|
|
46
|
+
selector: "select[uiSelect]",
|
|
47
|
+
inputs: {
|
|
48
|
+
size: {
|
|
49
|
+
classPropertyName: "size",
|
|
50
|
+
publicName: "size",
|
|
51
|
+
isSignal: true,
|
|
52
|
+
isRequired: false,
|
|
53
|
+
transformFunction: null
|
|
54
|
+
},
|
|
55
|
+
errors: {
|
|
56
|
+
classPropertyName: "errors",
|
|
57
|
+
publicName: "errors",
|
|
58
|
+
isSignal: true,
|
|
59
|
+
isRequired: false,
|
|
60
|
+
transformFunction: null
|
|
61
|
+
},
|
|
62
|
+
touched: {
|
|
63
|
+
classPropertyName: "touched",
|
|
64
|
+
publicName: "touched",
|
|
65
|
+
isSignal: true,
|
|
66
|
+
isRequired: false,
|
|
67
|
+
transformFunction: null
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
host: { properties: { "class": "classes()" } },
|
|
71
|
+
providers: [{
|
|
72
|
+
provide: UI_CONTROL,
|
|
73
|
+
useExisting: forwardRef(() => UiSelect)
|
|
74
|
+
}],
|
|
75
|
+
ngImport: i0
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
79
|
+
minVersion: "12.0.0",
|
|
80
|
+
version: "22.2.0",
|
|
81
|
+
ngImport: i0,
|
|
82
|
+
type: UiSelect,
|
|
83
|
+
decorators: [{
|
|
84
|
+
type: Directive,
|
|
85
|
+
args: [{
|
|
86
|
+
selector: "select[uiSelect]",
|
|
87
|
+
host: { "[class]": "classes()" },
|
|
88
|
+
providers: [{
|
|
89
|
+
provide: UI_CONTROL,
|
|
90
|
+
useExisting: forwardRef(() => UiSelect)
|
|
91
|
+
}]
|
|
92
|
+
}]
|
|
93
|
+
}],
|
|
94
|
+
propDecorators: {
|
|
95
|
+
size: [{
|
|
96
|
+
type: i0.Input,
|
|
97
|
+
args: [{
|
|
98
|
+
isSignal: true,
|
|
99
|
+
alias: "size",
|
|
100
|
+
required: false
|
|
101
|
+
}]
|
|
102
|
+
}],
|
|
103
|
+
errors: [{
|
|
104
|
+
type: i0.Input,
|
|
105
|
+
args: [{
|
|
106
|
+
isSignal: true,
|
|
107
|
+
alias: "errors",
|
|
108
|
+
required: false
|
|
109
|
+
}]
|
|
110
|
+
}],
|
|
111
|
+
touched: [{
|
|
112
|
+
type: i0.Input,
|
|
113
|
+
args: [{
|
|
114
|
+
isSignal: true,
|
|
115
|
+
alias: "touched",
|
|
116
|
+
required: false
|
|
117
|
+
}]
|
|
118
|
+
}]
|
|
119
|
+
}
|
|
120
|
+
});
|
|
68
121
|
export { UiSelect };
|
|
69
|
-
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=joanroucoux-cairn-ui-select.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joanroucoux-cairn-ui-select.mjs","
|
|
1
|
+
{"version":3,"file":"joanroucoux-cairn-ui-select.mjs","names":[],"sources":["../../../projects/ui/select/select.ts"],"sourcesContent":["import { Directive, computed, forwardRef, input } from '@angular/core';\n\nimport { UI_CONTROL, type UiControl, type UiControlError } from '@joanroucoux/cairn-ui/control';\nimport { CONTROL_BASE_CLASSES, CONTROL_SIZE_CLASSES, type ControlSize } from '@joanroucoux/cairn-ui/input';\n\nconst SELECT_CLASSES =\n 'cursor-pointer appearance-none pr-10 bg-(image:--chevron-down) bg-no-repeat bg-[position:right_0.75rem_center] bg-[size:1.125rem]';\n\n// Tailwind scans for literal strings: build no class by prefixing in code.\nconst PICKER_CLASSES = [\n 'pointer-fine:supports-[appearance:base-select]:[appearance:base-select]',\n 'pointer-fine:supports-[appearance:base-select]:items-center',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:cursor-pointer',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:rounded-control',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:px-2.5',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:py-2',\n 'pointer-fine:supports-[appearance:base-select]:[&_option:hover]:bg-(--soft)',\n 'pointer-fine:supports-[appearance:base-select]:[&_option:focus]:bg-(--soft)',\n 'pointer-fine:supports-[appearance:base-select]:[&_option:checked]:font-medium',\n '[&::picker-icon]:hidden',\n '[&::picker(select)]:[appearance:base-select]',\n '[&::picker(select)]:my-1.5',\n '[&::picker(select)]:rounded-control',\n '[&::picker(select)]:border',\n '[&::picker(select)]:border-(--border)',\n '[&::picker(select)]:bg-(--card)',\n '[&::picker(select)]:[position-try-fallbacks:none]',\n '[&::picker(select)]:overflow-y-auto',\n '[&::picker(select)]:p-1',\n '[&::picker(select)]:text-(--card-foreground)',\n].join(' ');\n\n/**\n * Styled native select, drop-down list included where the browser allows it. Declares the `errors`\n * and `touched` inputs Angular's `[formField]` fills, so a surrounding `ui-field` can show the message.\n *\n * @example\n * <select uiSelect><option value=\"pea\">PEA</option></select>\n */\n@Directive({\n selector: 'select[uiSelect]',\n host: {\n '[class]': 'classes()',\n },\n providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiSelect) }],\n})\nexport class UiSelect implements UiControl {\n readonly size = input<ControlSize>('md');\n readonly errors = input<readonly UiControlError[]>([]);\n readonly touched = input(false);\n\n protected readonly classes = computed(\n () =>\n `${CONTROL_BASE_CLASSES} bg-(--background) ${SELECT_CLASSES} ${PICKER_CLASSES} ${CONTROL_SIZE_CLASSES[this.size()]}`,\n );\n}\n"],"mappings":";;;;AAKA,MAAM,iBACJ;AAGF,MAAM,iBAAiB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAA,CAAC,KAAK,GAAG;AAgBV,IAAa,WAAb,MAAa,SAAQ;CACV,OAAO,MAAmB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,SAAS,MAAiC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC7C,UAAU,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEZ,UAAU,eAEzB,GAAG,qBAAoB,qBAAsB,eAAc,GAAI,eAAc,GAAI,qBAAqB,KAAK,KAAI,MAClH,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CARU,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,QAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA,EAAA,YAAA,EAAA,SAAA,YAAA,EAAA;EAAA,WAFR,CAAC;GAAE,SAAS;GAAY,aAAa,iBAAiB,QAAQ;EAAC,CAAE;EAAC,UAAA;CAAA,CAAA;;AAElE,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EAPpB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM,EACJ,WAAW,YACZ;GACD,WAAW,CAAC;IAAE,SAAS;IAAY,aAAa,iBAAgB,QAAS;GAAC,CAAE;EAC7E,CAAA"}
|
|
@@ -1,42 +1,89 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, computed, input } from "@angular/core";
|
|
3
|
+
const SKELETON_SHAPES = [
|
|
4
|
+
"text",
|
|
5
|
+
"figure",
|
|
6
|
+
"row",
|
|
7
|
+
"chart",
|
|
8
|
+
"ring",
|
|
9
|
+
"dot"
|
|
10
|
+
];
|
|
11
|
+
const LAST_LINE_WIDTH = "62%";
|
|
12
|
+
const PULSE_ANIMATION = "cairn-pulse var(--pulse-duration) var(--ease-out) infinite alternate";
|
|
13
|
+
const BAR_CLASSES = "block rounded-control bg-(--muted)";
|
|
14
|
+
var UiSkeleton = class UiSkeleton {
|
|
15
|
+
shape = input("text", ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
|
|
16
|
+
lines = input(1, ...ngDevMode ? [{ debugName: "lines" }] : /* istanbul ignore next */ []);
|
|
17
|
+
height = input(12, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
|
|
18
|
+
size = input(232, ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
19
|
+
animation = PULSE_ANIMATION;
|
|
20
|
+
bars = computed(() => {
|
|
21
|
+
const count = Math.max(1, this.lines());
|
|
22
|
+
return Array.from({ length: count }, (_, index) => index === count - 1 && count > 1 ? LAST_LINE_WIDTH : "100%");
|
|
23
|
+
}, ...ngDevMode ? [{ debugName: "bars" }] : /* istanbul ignore next */ []);
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
25
|
+
minVersion: "12.0.0",
|
|
26
|
+
version: "22.2.0",
|
|
27
|
+
ngImport: i0,
|
|
28
|
+
type: UiSkeleton,
|
|
29
|
+
deps: [],
|
|
30
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
31
|
+
});
|
|
32
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
33
|
+
minVersion: "17.0.0",
|
|
34
|
+
version: "22.2.0",
|
|
35
|
+
type: UiSkeleton,
|
|
36
|
+
isStandalone: true,
|
|
37
|
+
selector: "ui-skeleton",
|
|
38
|
+
inputs: {
|
|
39
|
+
shape: {
|
|
40
|
+
classPropertyName: "shape",
|
|
41
|
+
publicName: "shape",
|
|
42
|
+
isSignal: true,
|
|
43
|
+
isRequired: false,
|
|
44
|
+
transformFunction: null
|
|
45
|
+
},
|
|
46
|
+
lines: {
|
|
47
|
+
classPropertyName: "lines",
|
|
48
|
+
publicName: "lines",
|
|
49
|
+
isSignal: true,
|
|
50
|
+
isRequired: false,
|
|
51
|
+
transformFunction: null
|
|
52
|
+
},
|
|
53
|
+
height: {
|
|
54
|
+
classPropertyName: "height",
|
|
55
|
+
publicName: "height",
|
|
56
|
+
isSignal: true,
|
|
57
|
+
isRequired: false,
|
|
58
|
+
transformFunction: null
|
|
59
|
+
},
|
|
60
|
+
size: {
|
|
61
|
+
classPropertyName: "size",
|
|
62
|
+
publicName: "size",
|
|
63
|
+
isSignal: true,
|
|
64
|
+
isRequired: false,
|
|
65
|
+
transformFunction: null
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
host: {
|
|
69
|
+
attributes: { "aria-hidden": "true" },
|
|
70
|
+
classAttribute: "flex flex-col gap-2"
|
|
71
|
+
},
|
|
72
|
+
ngImport: i0,
|
|
73
|
+
template: "\n @switch (shape()) {\n @case ('figure') {\n <span class=\"block rounded-control bg-(--muted) h-10 w-65\" [style.animation]=\"animation\"></span>\n }\n @case ('row') {\n <span class=\"flex h-14 items-center justify-between gap-4\">\n <span class=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <span class=\"block rounded-control bg-(--muted) h-4 w-3/5\" [style.animation]=\"animation\"></span>\n <span class=\"block rounded-control bg-(--muted) h-3 w-20\" [style.animation]=\"animation\"></span>\n </span>\n <span class=\"block rounded-control bg-(--muted) h-4 w-[90px] flex-none\" [style.animation]=\"animation\"></span>\n </span>\n }\n @case ('chart') {\n <span class=\"rounded-control min-h-50 w-full flex-1 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('dot') {\n <span class=\"rounded-pill size-3 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('ring') {\n <span\n class=\"rounded-pill shadow-[inset_0_0_0_30px_var(--muted)]\"\n [style.animation]=\"animation\"\n [style.height.px]=\"size()\"\n [style.width.px]=\"size()\"\n ></span>\n }\n @default {\n @for (line of bars(); track $index) {\n <span\n class=\"block rounded-control bg-(--muted)\"\n [style.animation]=\"animation\"\n [style.height.px]=\"height()\"\n [style.width]=\"line\"\n ></span>\n }\n }\n }\n ",
|
|
74
|
+
isInline: true
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
78
|
+
minVersion: "12.0.0",
|
|
79
|
+
version: "22.2.0",
|
|
80
|
+
ngImport: i0,
|
|
81
|
+
type: UiSkeleton,
|
|
82
|
+
decorators: [{
|
|
83
|
+
type: Component,
|
|
84
|
+
args: [{
|
|
85
|
+
selector: "ui-skeleton",
|
|
86
|
+
template: `
|
|
40
87
|
@switch (shape()) {
|
|
41
88
|
@case ('figure') {
|
|
42
89
|
<span class="${BAR_CLASSES} h-10 w-65" [style.animation]="animation"></span>
|
|
@@ -76,16 +123,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
76
123
|
}
|
|
77
124
|
}
|
|
78
125
|
`,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
126
|
+
host: {
|
|
127
|
+
"aria-hidden": "true",
|
|
128
|
+
class: "flex flex-col gap-2"
|
|
129
|
+
}
|
|
130
|
+
}]
|
|
131
|
+
}],
|
|
132
|
+
propDecorators: {
|
|
133
|
+
shape: [{
|
|
134
|
+
type: i0.Input,
|
|
135
|
+
args: [{
|
|
136
|
+
isSignal: true,
|
|
137
|
+
alias: "shape",
|
|
138
|
+
required: false
|
|
139
|
+
}]
|
|
140
|
+
}],
|
|
141
|
+
lines: [{
|
|
142
|
+
type: i0.Input,
|
|
143
|
+
args: [{
|
|
144
|
+
isSignal: true,
|
|
145
|
+
alias: "lines",
|
|
146
|
+
required: false
|
|
147
|
+
}]
|
|
148
|
+
}],
|
|
149
|
+
height: [{
|
|
150
|
+
type: i0.Input,
|
|
151
|
+
args: [{
|
|
152
|
+
isSignal: true,
|
|
153
|
+
alias: "height",
|
|
154
|
+
required: false
|
|
155
|
+
}]
|
|
156
|
+
}],
|
|
157
|
+
size: [{
|
|
158
|
+
type: i0.Input,
|
|
159
|
+
args: [{
|
|
160
|
+
isSignal: true,
|
|
161
|
+
alias: "size",
|
|
162
|
+
required: false
|
|
163
|
+
}]
|
|
164
|
+
}]
|
|
165
|
+
}
|
|
166
|
+
});
|
|
90
167
|
export { SKELETON_SHAPES, UiSkeleton };
|
|
91
|
-
|
|
168
|
+
|
|
169
|
+
//# sourceMappingURL=joanroucoux-cairn-ui-skeleton.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joanroucoux-cairn-ui-skeleton.mjs","
|
|
1
|
+
{"version":3,"file":"joanroucoux-cairn-ui-skeleton.mjs","names":[],"sources":["../../../projects/ui/skeleton/skeleton.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\n\n/** Available skeleton shapes. */\nexport const SKELETON_SHAPES = ['text', 'figure', 'row', 'chart', 'ring', 'dot'] as const;\nexport type SkeletonShape = (typeof SKELETON_SHAPES)[number];\n\nconst LAST_LINE_WIDTH = '62%';\n\nconst PULSE_ANIMATION = 'cairn-pulse var(--pulse-duration) var(--ease-out) infinite alternate';\n\nconst BAR_CLASSES = 'block rounded-control bg-(--muted)';\n\n/**\n * Decorative, pulsing placeholder for content that is still loading.\n *\n * @example\n * <ui-skeleton shape=\"figure\" />\n * <ui-skeleton [lines]=\"3\" />\n */\n@Component({\n selector: 'ui-skeleton',\n template: `\n @switch (shape()) {\n @case ('figure') {\n <span class=\"${BAR_CLASSES} h-10 w-65\" [style.animation]=\"animation\"></span>\n }\n @case ('row') {\n <span class=\"flex h-14 items-center justify-between gap-4\">\n <span class=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <span class=\"${BAR_CLASSES} h-4 w-3/5\" [style.animation]=\"animation\"></span>\n <span class=\"${BAR_CLASSES} h-3 w-20\" [style.animation]=\"animation\"></span>\n </span>\n <span class=\"${BAR_CLASSES} h-4 w-[90px] flex-none\" [style.animation]=\"animation\"></span>\n </span>\n }\n @case ('chart') {\n <span class=\"rounded-control min-h-50 w-full flex-1 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('dot') {\n <span class=\"rounded-pill size-3 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('ring') {\n <span\n class=\"rounded-pill shadow-[inset_0_0_0_30px_var(--muted)]\"\n [style.animation]=\"animation\"\n [style.height.px]=\"size()\"\n [style.width.px]=\"size()\"\n ></span>\n }\n @default {\n @for (line of bars(); track $index) {\n <span\n class=\"${BAR_CLASSES}\"\n [style.animation]=\"animation\"\n [style.height.px]=\"height()\"\n [style.width]=\"line\"\n ></span>\n }\n }\n }\n `,\n host: {\n 'aria-hidden': 'true',\n class: 'flex flex-col gap-2',\n },\n})\nexport class UiSkeleton {\n readonly shape = input<SkeletonShape>('text');\n readonly lines = input(1);\n readonly height = input(12);\n readonly size = input(232);\n\n protected readonly animation = PULSE_ANIMATION;\n\n protected readonly bars = computed(() => {\n const count = Math.max(1, this.lines());\n\n return Array.from({ length: count }, (_, index) => (index === count - 1 && count > 1 ? LAST_LINE_WIDTH : '100%'));\n });\n}\n"],"mappings":";;AAGA,MAAa,kBAAkB;CAAC;CAAQ;CAAU;CAAO;CAAS;CAAQ;AAAK;AAG/E,MAAM,kBAAkB;AAExB,MAAM,kBAAkB;AAExB,MAAM,cAAc;AAwDpB,IAAa,aAAb,MAAa,WAAU;CACZ,QAAQ,MAAqB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,QAAQ,MAAM,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChB,SAAS,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAClB,OAAO,MAAM,KAAI,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAEP,YAAY;CAEZ,OAAO,eAAc;EACtC,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAK,CAAE;EAEtC,OAAO,MAAM,KAAK,EAAE,QAAQ,MAAK,IAAK,GAAG,UAAW,UAAU,QAAQ,KAAK,QAAQ,IAAI,kBAAkB,MAAO;CAClH,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAZS,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAU,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAV,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAU,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;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,MAAA;GAAA,YAAA,EAAA,eAAA,OAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAAV,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EA/CtB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;;;uBAGW,YAAW;;;;;2BAKP,YAAW;2BACX,YAAW;;yBAEb,YAAW;;;;;;;;;;;;;;;;;;;;qBAoBf,YAAW;;;;;;;;;GAS9B,MAAM;IACJ,eAAe;IACf,OAAO;GACR;EACF,CAAA"}
|
|
@@ -1,43 +1,84 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const STALE_LINK_SIZES = ['caption', 'label'];
|
|
6
|
-
const BASE_CLASSES = "relative inline-flex items-center gap-0.5 rounded-[4px] font-medium text-(--stale) hover:underline underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:h-11 pointer-fine:before:h-10 before:-translate-y-1/2 before:content-['']";
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Directive, booleanAttribute, computed, input } from "@angular/core";
|
|
3
|
+
const STALE_LINK_SIZES = ["caption", "label"];
|
|
4
|
+
const BASE_CLASSES = "relative inline-flex items-center gap-1 pointer-fine:gap-0.5 rounded-[4px] font-medium text-(--stale) hover:underline underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:h-11 pointer-fine:before:h-10 before:-translate-y-1/2 before:content-['']";
|
|
7
5
|
const SIZE_CLASSES = {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
caption: "text-caption",
|
|
7
|
+
label: "text-label"
|
|
10
8
|
};
|
|
11
9
|
const CHEVRON_CLASSES = "after:size-4 after:flex-none after:bg-current after:content-[''] after:mask-center after:mask-no-repeat after:mask-[url(data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m9%2018%206-6-6-6%27%2F%3E%3C%2Fsvg%3E)]";
|
|
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
|
-
|
|
10
|
+
var UiStaleLink = class UiStaleLink {
|
|
11
|
+
chevron = input(false, {
|
|
12
|
+
...ngDevMode ? { debugName: "chevron" } : /* istanbul ignore next */ {},
|
|
13
|
+
transform: booleanAttribute
|
|
14
|
+
});
|
|
15
|
+
size = input("caption", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
16
|
+
classes = computed(() => `${BASE_CLASSES} ${SIZE_CLASSES[this.size()]}${this.chevron() ? ` ${CHEVRON_CLASSES}` : ""}`, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
18
|
+
minVersion: "12.0.0",
|
|
19
|
+
version: "22.2.0",
|
|
20
|
+
ngImport: i0,
|
|
21
|
+
type: UiStaleLink,
|
|
22
|
+
deps: [],
|
|
23
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
24
|
+
});
|
|
25
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
26
|
+
minVersion: "17.1.0",
|
|
27
|
+
version: "22.2.0",
|
|
28
|
+
type: UiStaleLink,
|
|
29
|
+
isStandalone: true,
|
|
30
|
+
selector: "a[uiStaleLink]",
|
|
31
|
+
inputs: {
|
|
32
|
+
chevron: {
|
|
33
|
+
classPropertyName: "chevron",
|
|
34
|
+
publicName: "chevron",
|
|
35
|
+
isSignal: true,
|
|
36
|
+
isRequired: false,
|
|
37
|
+
transformFunction: null
|
|
38
|
+
},
|
|
39
|
+
size: {
|
|
40
|
+
classPropertyName: "size",
|
|
41
|
+
publicName: "size",
|
|
42
|
+
isSignal: true,
|
|
43
|
+
isRequired: false,
|
|
44
|
+
transformFunction: null
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
host: { properties: { "class": "classes()" } },
|
|
48
|
+
ngImport: i0
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
52
|
+
minVersion: "12.0.0",
|
|
53
|
+
version: "22.2.0",
|
|
54
|
+
ngImport: i0,
|
|
55
|
+
type: UiStaleLink,
|
|
56
|
+
decorators: [{
|
|
57
|
+
type: Directive,
|
|
58
|
+
args: [{
|
|
59
|
+
selector: "a[uiStaleLink]",
|
|
60
|
+
host: { "[class]": "classes()" }
|
|
61
|
+
}]
|
|
62
|
+
}],
|
|
63
|
+
propDecorators: {
|
|
64
|
+
chevron: [{
|
|
65
|
+
type: i0.Input,
|
|
66
|
+
args: [{
|
|
67
|
+
isSignal: true,
|
|
68
|
+
alias: "chevron",
|
|
69
|
+
required: false
|
|
70
|
+
}]
|
|
71
|
+
}],
|
|
72
|
+
size: [{
|
|
73
|
+
type: i0.Input,
|
|
74
|
+
args: [{
|
|
75
|
+
isSignal: true,
|
|
76
|
+
alias: "size",
|
|
77
|
+
required: false
|
|
78
|
+
}]
|
|
79
|
+
}]
|
|
80
|
+
}
|
|
81
|
+
});
|
|
42
82
|
export { STALE_LINK_SIZES, UiStaleLink };
|
|
43
|
-
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=joanroucoux-cairn-ui-stale-link.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joanroucoux-cairn-ui-stale-link.mjs","
|
|
1
|
+
{"version":3,"file":"joanroucoux-cairn-ui-stale-link.mjs","names":[],"sources":["../../../projects/ui/stale-link/stale-link.ts"],"sourcesContent":["import { Directive, booleanAttribute, computed, input } from '@angular/core';\n\n/** Available stale link sizes. */\nexport const STALE_LINK_SIZES = ['caption', 'label'] as const;\nexport type StaleLinkSize = (typeof STALE_LINK_SIZES)[number];\n\nconst BASE_CLASSES =\n \"relative inline-flex items-center gap-1 pointer-fine:gap-0.5 rounded-[4px] font-medium text-(--stale) hover:underline underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:h-11 pointer-fine:before:h-10 before:-translate-y-1/2 before:content-['']\";\n\nconst SIZE_CLASSES: Record<StaleLinkSize, string> = {\n caption: 'text-caption',\n label: 'text-label',\n};\n\nconst CHEVRON_CLASSES =\n \"after:size-4 after:flex-none after:bg-current after:content-[''] after:mask-center after:mask-no-repeat after:mask-[url(data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m9%2018%206-6-6-6%27%2F%3E%3C%2Fsvg%3E)]\";\n\n/**\n * Link in the stale tone, for a caption about data that is late or left out of a total, such as\n * \"1 ligne sans cours, non comptée\". `chevron` adds a trailing chevron, `size` is `caption` (the\n * default) or `label`.\n *\n * @example\n * <a uiStaleLink chevron size=\"label\" routerLink=\"/holdings\">1 cours en retard</a>\n */\n@Directive({\n selector: 'a[uiStaleLink]',\n host: { '[class]': 'classes()' },\n})\nexport class UiStaleLink {\n readonly chevron = input(false, { transform: booleanAttribute });\n readonly size = input<StaleLinkSize>('caption');\n\n protected readonly classes = computed(\n () => `${BASE_CLASSES} ${SIZE_CLASSES[this.size()]}${this.chevron() ? ` ${CHEVRON_CLASSES}` : ''}`,\n );\n}\n"],"mappings":";;AAGA,MAAa,mBAAmB,CAAC,WAAW,OAAO;AAGnD,MAAM,eACJ;AAEF,MAAM,eAA8C;CAClD,SAAS;CACT,OAAO;AACR;AAED,MAAM,kBACJ;AAcF,IAAa,cAAb,MAAa,YAAW;CACb,UAAU,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACpD,OAAO,MAAqB,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,UAAU,eACrB,GAAG,aAAY,GAAI,aAAa,KAAK,KAAI,KAAM,KAAK,QAAO,IAAK,IAAI,oBAAoB,MAC/F,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CANU,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAW,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAX,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAW,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,SAAA;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,MAAA,EAAA,YAAA,EAAA,SAAA,YAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAX,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAW,YAAA,CAAA;EAJvB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM,EAAE,WAAW,YAAW;EAC/B,CAAA"}
|