@alfakit/vue 0.1.1 → 0.1.2
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 +8 -0
- package/dist/components/actions/ActionButton.js.map +1 -1
- package/dist/components/actions/ActionButton.vue.d.ts.map +1 -1
- package/dist/components/actions/ActionButton.vue_vue_type_script_setup_true_lang.js +160 -159
- package/dist/components/actions/ActionButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/actions/ActionModal.js.map +1 -1
- package/dist/components/actions/ActionModal.vue.d.ts.map +1 -1
- package/dist/components/actions/ActionModal.vue_vue_type_script_setup_true_lang.js +214 -214
- package/dist/components/actions/ActionModal.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/ColorPickerField.js.map +1 -1
- package/dist/components/fields/ColorPickerField.vue.d.ts.map +1 -1
- package/dist/components/fields/ColorPickerField.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/fields/ColorPickerField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/ComboboxSelect.js.map +1 -1
- package/dist/components/fields/ComboboxSelect.vue.d.ts.map +1 -1
- package/dist/components/fields/ComboboxSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/fields/ComboboxSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/FileUploadField.js.map +1 -1
- package/dist/components/fields/FileUploadField.vue.d.ts.map +1 -1
- package/dist/components/fields/FileUploadField.vue_vue_type_script_setup_true_lang.js +183 -183
- package/dist/components/fields/FileUploadField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/OneTimeCodeInputField.js.map +1 -1
- package/dist/components/fields/OneTimeCodeInputField.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/fields/OneTimeCodeInputField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/SelectField.js.map +1 -1
- package/dist/components/fields/SelectField.vue.d.ts.map +1 -1
- package/dist/components/fields/SelectField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/fields/SelectField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/TableColumnHeaders.js.map +1 -1
- package/dist/components/fields/TableColumnHeaders.vue.d.ts.map +1 -1
- package/dist/components/fields/TableColumnHeaders.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/components/fields/TableColumnHeaders.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/file-manager/FileManagerView.js.map +1 -1
- package/dist/components/file-manager/FileManagerView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/file-manager/FileManagerView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form/FormBlock.js.map +1 -1
- package/dist/components/form/FormBlock.vue.d.ts.map +1 -1
- package/dist/components/form/FormBlock.vue_vue_type_script_setup_true_lang.js +81 -77
- package/dist/components/form/FormBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form/form-context.js +25 -25
- package/dist/components/form/form-context.js.map +1 -1
- package/dist/components/layout/FusedGroupComponent.js.map +1 -1
- package/dist/components/layout/FusedGroupComponent.vue.d.ts.map +1 -1
- package/dist/components/layout/FusedGroupComponent.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/layout/FusedGroupComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/layout/TabsComponent.js.map +1 -1
- package/dist/components/layout/TabsComponent.vue.d.ts.map +1 -1
- package/dist/components/layout/TabsComponent.vue_vue_type_script_setup_true_lang.js +76 -55
- package/dist/components/layout/TabsComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/notifications/NotificationsMenu.js.map +1 -1
- package/dist/components/notifications/NotificationsMenu.vue.d.ts.map +1 -1
- package/dist/components/notifications/NotificationsMenu.vue_vue_type_script_setup_true_lang.js +44 -42
- package/dist/components/notifications/NotificationsMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/GlobalSearch.js.map +1 -1
- package/dist/components/panel/GlobalSearch.vue.d.ts.map +1 -1
- package/dist/components/panel/GlobalSearch.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/panel/GlobalSearch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/ShortcutKeys.js.map +1 -1
- package/dist/components/panel/ShortcutKeys.vue.d.ts.map +1 -1
- package/dist/components/panel/ShortcutKeys.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/panel/ShortcutKeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/TenantMenu.js.map +1 -1
- package/dist/components/panel/TenantMenu.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/panel/TenantMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/GroupHeaderRow.js.map +1 -1
- package/dist/components/table/GroupHeaderRow.vue.d.ts.map +1 -1
- package/dist/components/table/GroupHeaderRow.vue_vue_type_script_setup_true_lang.js +55 -34
- package/dist/components/table/GroupHeaderRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/SelectCell.js.map +1 -1
- package/dist/components/table/SelectCell.vue.d.ts.map +1 -1
- package/dist/components/table/SelectCell.vue_vue_type_script_setup_true_lang.js +24 -19
- package/dist/components/table/SelectCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/TextInputCell.js.map +1 -1
- package/dist/components/table/TextInputCell.vue.d.ts.map +1 -1
- package/dist/components/table/TextInputCell.vue_vue_type_script_setup_true_lang.js +38 -33
- package/dist/components/table/TextInputCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components.css +347 -0
- package/dist/eject-manifest.json +2 -2
- package/dist/standalone/AlfakitToaster.js.map +1 -1
- package/dist/standalone/AlfakitToaster.vue.d.ts.map +1 -1
- package/dist/standalone/AlfakitToaster.vue_vue_type_script_setup_true_lang.js +23 -15
- package/dist/standalone/AlfakitToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone.css +47 -0
- package/dist/starter-kit/widgets/SearchTrigger.js.map +1 -1
- package/dist/starter-kit/widgets/SearchTrigger.vue.d.ts.map +1 -1
- package/dist/starter-kit/widgets/SearchTrigger.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/starter-kit/widgets/SearchTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/starter-kit/widgets/TenantChooser.js.map +1 -1
- package/dist/starter-kit/widgets/TenantChooser.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/starter-kit/widgets/TenantChooser.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/themes.css +2 -334
- package/package.json +3 -3
- package/src/components/actions/ActionButton.vue +14 -6
- package/src/components/actions/ActionModal.vue +3 -1
- package/src/components/fields/ColorPickerField.vue +1 -0
- package/src/components/fields/ComboboxSelect.vue +1 -1
- package/src/components/fields/FileUploadField.vue +14 -11
- package/src/components/fields/OneTimeCodeInputField.vue +1 -1
- package/src/components/fields/SelectField.vue +4 -2
- package/src/components/fields/TableColumnHeaders.vue +6 -1
- package/src/components/file-manager/FileManagerView.vue +1 -1
- package/src/components/form/FormBlock.vue +24 -0
- package/src/components/form/form-context.ts +2 -2
- package/src/components/layout/FusedGroupComponent.vue +1 -0
- package/src/components/layout/TabsComponent.vue +61 -5
- package/src/components/notifications/NotificationsMenu.vue +11 -0
- package/src/components/panel/GlobalSearch.vue +1 -0
- package/src/components/panel/ShortcutKeys.vue +1 -0
- package/src/components/panel/TenantMenu.vue +2 -2
- package/src/components/table/GroupHeaderRow.vue +27 -0
- package/src/components/table/SelectCell.vue +5 -2
- package/src/components/table/TextInputCell.vue +11 -5
- package/src/standalone/AlfakitToaster.vue +12 -2
- package/src/starter-kit/widgets/SearchTrigger.vue +1 -0
- package/src/starter-kit/widgets/TenantChooser.vue +1 -1
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
2
|
import { useCellUpdate as t } from "./cell-update.js";
|
|
3
3
|
import { isOptionGroup as n } from "@alfakit/core";
|
|
4
|
-
import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, ref as d, renderList as f, toDisplayString as p, unref as m,
|
|
4
|
+
import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, ref as d, renderList as f, toDisplayString as p, unref as m, useId as h, withModifiers as g } from "vue";
|
|
5
5
|
//#region src/components/table/SelectCell.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var _ = [
|
|
7
7
|
"value",
|
|
8
8
|
"disabled",
|
|
9
|
-
"aria-
|
|
10
|
-
|
|
9
|
+
"aria-label",
|
|
10
|
+
"aria-invalid",
|
|
11
|
+
"aria-describedby"
|
|
12
|
+
], v = {
|
|
11
13
|
key: 0,
|
|
12
14
|
value: ""
|
|
13
|
-
},
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "text-destructive block text-xs"
|
|
16
|
-
}, b = /*@__PURE__*/ c({
|
|
15
|
+
}, y = ["value", "disabled"], b = ["id"], x = /*@__PURE__*/ c({
|
|
17
16
|
__name: "SelectCell",
|
|
18
17
|
props: {
|
|
19
18
|
column: {},
|
|
@@ -23,23 +22,29 @@ var g = [
|
|
|
23
22
|
component: {}
|
|
24
23
|
},
|
|
25
24
|
setup(c) {
|
|
26
|
-
let
|
|
27
|
-
|
|
25
|
+
let x = c, S = i(() => x.column), { update: C, saving: w, error: T } = t(x), E = h(), D = d(x.cell.state === null || x.cell.state === void 0 ? "" : String(x.cell.state)), O = i(() => S.value.options.flatMap((e) => n(e) ? e.options : [e]).filter((e) => !(S.value.ignoreRecord && e.value === String(x.recordKey)))), k = (e) => {
|
|
26
|
+
D.value = e.target.value, C(D.value === "" ? null : D.value);
|
|
28
27
|
};
|
|
29
|
-
return (t, n) => (u(), o("span", { onClick: n[0] ||=
|
|
30
|
-
value:
|
|
31
|
-
disabled: !!
|
|
32
|
-
"aria-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
return (t, n) => (u(), o("span", { onClick: n[0] ||= g(() => {}, ["stop"]) }, [s("select", {
|
|
29
|
+
value: D.value,
|
|
30
|
+
disabled: !!x.cell.disabled || m(w),
|
|
31
|
+
"aria-label": x.column.label || x.column.name,
|
|
32
|
+
"aria-invalid": m(T) ? !0 : void 0,
|
|
33
|
+
"aria-describedby": m(T) ? m(E) : void 0,
|
|
34
|
+
class: l(m(e)("border-input dark:bg-input/30 focus-visible:ring-ring/50 h-8 min-w-32 rounded-md border bg-transparent px-2 text-sm shadow-xs outline-none focus-visible:ring-[3px]", m(T) && "border-destructive")),
|
|
35
|
+
onChange: k
|
|
36
|
+
}, [S.value.selectablePlaceholder ? (u(), o("option", v, p(S.value.placeholder ?? ""), 1)) : a("", !0), (u(!0), o(r, null, f(O.value, (e) => (u(), o("option", {
|
|
36
37
|
key: e.value,
|
|
37
38
|
value: e.value,
|
|
38
39
|
disabled: e.disabled
|
|
39
|
-
}, p(e.label), 9,
|
|
40
|
+
}, p(e.label), 9, y))), 128))], 42, _), m(T) ? (u(), o("span", {
|
|
41
|
+
key: 0,
|
|
42
|
+
id: m(E),
|
|
43
|
+
class: "text-destructive block text-xs"
|
|
44
|
+
}, p(m(T)), 9, b)) : a("", !0)]));
|
|
40
45
|
}
|
|
41
46
|
});
|
|
42
47
|
//#endregion
|
|
43
|
-
export {
|
|
48
|
+
export { x as default };
|
|
44
49
|
|
|
45
50
|
//# sourceMappingURL=SelectCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_withModifiers","_createElementVNode","_unref","_normalizeClass","_toDisplayString","_createCommentVNode","_Fragment","_renderList","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","SelectCell_vue_vue_type_script_setup_true_lang_default","props","__props","schema","computed","useCellUpdate","value","ref","options","isOptionGroup","option","onChange","event","update","openBlock","createElementBlock","_cache","withModifiers","createElementVNode","unref","saving","error","normalizeClass","cn","toDisplayString","createCommentVNode","Fragment","renderList"],"sources":["../../../src/components/table/SelectCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { SelectColumnSchema } from '@alfakit/core'\nimport { isOptionGroup } from '@alfakit/core'\nimport { computed, ref } from 'vue'\nimport { cn } from '../../lib/utils'\nimport { useCellUpdate, type CellProps } from './cell-update'\n\nconst props = defineProps<CellProps>()\nconst schema = computed(() => props.column as SelectColumnSchema)\nconst { update, saving, error } = useCellUpdate(props)\nconst value = ref(\n props.cell.state === null || props.cell.state === undefined ? '' : String(props.cell.state),\n)\n// `optionsRelationship(ignoreRecord: true)`: the record itself is not an option.\nconst options = computed(() =>\n schema.value.options\n .flatMap((option) => (isOptionGroup(option) ? option.options : [option]))\n .filter((option) => !(schema.value.ignoreRecord && option.value === String(props.recordKey))),\n)\n\nconst onChange = (event: Event) => {\n value.value = (event.target as HTMLSelectElement).value\n void update(value.value === '' ? null : value.value)\n}\n</script>\n\n<template>\n <span @click.stop>\n <select\n :value=\"value\"\n :disabled=\"Boolean(props.cell.disabled) || saving\"\n :aria-invalid=\"error ? true : undefined\"\n :class=\"\n cn(\n 'border-input dark:bg-input/30 focus-visible:ring-ring/50 h-8 min-w-32 rounded-md border bg-transparent px-2 text-sm shadow-xs outline-none focus-visible:ring-[3px]',\n error && 'border-destructive',\n )\n \"\n @change=\"onChange\"\n >\n <option v-if=\"schema.selectablePlaceholder\" value=\"\">{{ schema.placeholder ?? '' }}</option>\n <option\n v-for=\"option in options\"\n :key=\"option.value\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n >\n {{ option.label }}\n </option>\n </select>\n <span v-if=\"error\" class=\"text-destructive block text-xs\">{{ error }}</span>\n </span>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_withModifiers","_createElementVNode","_unref","_normalizeClass","_toDisplayString","_createCommentVNode","_Fragment","_renderList","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","SelectCell_vue_vue_type_script_setup_true_lang_default","props","__props","schema","computed","useCellUpdate","errorId","useId","value","ref","options","isOptionGroup","option","onChange","event","update","openBlock","createElementBlock","_cache","withModifiers","createElementVNode","unref","saving","error","normalizeClass","cn","toDisplayString","createCommentVNode","Fragment","renderList"],"sources":["../../../src/components/table/SelectCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { SelectColumnSchema } from '@alfakit/core'\nimport { isOptionGroup } from '@alfakit/core'\nimport { computed, ref, useId } from 'vue'\nimport { cn } from '../../lib/utils'\nimport { useCellUpdate, type CellProps } from './cell-update'\n\nconst props = defineProps<CellProps>()\nconst schema = computed(() => props.column as SelectColumnSchema)\nconst { update, saving, error } = useCellUpdate(props)\nconst errorId = useId()\nconst value = ref(\n props.cell.state === null || props.cell.state === undefined ? '' : String(props.cell.state),\n)\n// `optionsRelationship(ignoreRecord: true)`: the record itself is not an option.\nconst options = computed(() =>\n schema.value.options\n .flatMap((option) => (isOptionGroup(option) ? option.options : [option]))\n .filter((option) => !(schema.value.ignoreRecord && option.value === String(props.recordKey))),\n)\n\nconst onChange = (event: Event) => {\n value.value = (event.target as HTMLSelectElement).value\n void update(value.value === '' ? null : value.value)\n}\n</script>\n\n<template>\n <span @click.stop>\n <select\n :value=\"value\"\n :disabled=\"Boolean(props.cell.disabled) || saving\"\n :aria-label=\"props.column.label || props.column.name\"\n :aria-invalid=\"error ? true : undefined\"\n :aria-describedby=\"error ? errorId : undefined\"\n :class=\"\n cn(\n 'border-input dark:bg-input/30 focus-visible:ring-ring/50 h-8 min-w-32 rounded-md border bg-transparent px-2 text-sm shadow-xs outline-none focus-visible:ring-[3px]',\n error && 'border-destructive',\n )\n \"\n @change=\"onChange\"\n >\n <option v-if=\"schema.selectablePlaceholder\" value=\"\">{{ schema.placeholder ?? '' }}</option>\n <option\n v-for=\"option in options\"\n :key=\"option.value\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n >\n {{ option.label }}\n </option>\n </select>\n <span v-if=\"error\" :id=\"errorId\" class=\"text-destructive block text-xs\">{{ error }}</span>\n </span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAOA,IAAMe,IAAQC,GACRC,IAASC,QAAeH,EAAM,MAA4B,GAC1D,EAAE,WAAQ,WAAQ,aAAUI,EAAcJ,CAAK,GAC/CK,IAAUC,EAAM,GAChBC,IAAQC,EACZR,EAAM,KAAK,UAAU,QAAQA,EAAM,KAAK,UAAU,KAAA,IAAY,KAAK,OAAOA,EAAM,KAAK,KAAK,CAC5F,GAEMS,IAAUN,QACdD,EAAO,MAAM,QACV,SAAS,MAAYQ,EAAcC,CAAM,IAAIA,EAAO,UAAU,CAACA,CAAM,CAAE,CAAA,CACvE,QAAQ,MAAW,EAAET,EAAO,MAAM,gBAAgBS,EAAO,UAAU,OAAOX,EAAM,SAAS,EAAE,CAChG,GAEMY,KAAY,MAAiB;GAEjC,AADA,EAAM,QAASC,EAAM,OAA6B,OAClDC,EAAYP,EAAM,UAAU,KAAK,OAAOA,EAAM,KAAK;EACrD;oBAIEtB,EAAA,GAAAC,EA0BO,QAAA,EA1BA,SAAK,AAAA+B,EAAA,OAAA9B,QAAN,CAAA,GAAW,CAAA,MAAA,CAAA,EAAA,GAAA,CACfC,EAuBS,UAAA;GAtBN,OAAOmB,EAAA;GACP,UAAU,EAAQP,EAAM,KAAK,YAAaX,EAAAgC,CAAA;GAC1C,cAAYrB,EAAM,OAAO,SAASA,EAAM,OAAO;GAC/C,gBAAcX,EAAAiC,CAAA,IAAK,KAAU,KAAA;GAC7B,oBAAkBjC,EAAAiC,CAAA,IAAQjC,EAAAgB,CAAA,IAAU,KAAA;GACpC,OAAKf,EAAWD,EAAAmC,CAAA,CAAE,CAAA,uKAA6LnC,EAAAiC,CAAA,KAAK,oBAAA,CAAA;GAM5M;EAEK,GAAA,CAAApB,EAAA,MAAO,yBAArBjB,EAAA,GAAAC,EAA4F,UAA5FU,GAA4FL,EAApCW,EAAA,MAAO,eAAW,EAAA,GAAA,CAAA,KAAAwB,EAAA,IAAA,EAAA,IAC1EzC,EAAA,EAAA,GAAAC,EAOSO,GAAA,MAAAC,EANUe,EAAA,QAAV,OADTxB,EAAA,GAAAC,EAOS,UAAA;GALN,KAAKyB,EAAO;GACZ,OAAOA,EAAO;GACd,UAAUA,EAAO;EAEf,GAAApB,EAAAoB,EAAO,KAAK,GAAA,GAAAd,CAAA,EAGPR,GAAAA,GAAAA,EAAAA,GAAAA,IAAAA,CAAAA,GAAAA,EAAAiC,CAAA,KAAZrC,EAAA,GAAAC,EAA0F,QAAA;;GAAtE,IAAIG,EAAAgB,CAAA;GAAS,OAAM;EAAoC,GAAAd,EAAAF,EAAAiC,CAAA,CAAK,GAAA,GAAAxB,CAAA,KAAA4B,EAAA,IAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputCell.js","names":["_sfc_main","TextInputCell_vue_vue_type_script_setup_true_lang_default","TextInputCell_default"],"sources":["../../../src/components/table/TextInputCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { TextInputColumnSchema } from '@alfakit/core'\nimport { computed, ref } from 'vue'\nimport { colorClass, textColorClasses } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Input from '../ui/Input.vue'\nimport { useCellUpdate, type CellProps } from './cell-update'\n\nconst props = defineProps<CellProps>()\nconst schema = computed(() => props.column as TextInputColumnSchema)\nconst { update, saving, error } = useCellUpdate(props)\nconst initial
|
|
1
|
+
{"version":3,"file":"TextInputCell.js","names":["_sfc_main","TextInputCell_vue_vue_type_script_setup_true_lang_default","TextInputCell_default"],"sources":["../../../src/components/table/TextInputCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { TextInputColumnSchema } from '@alfakit/core'\nimport { computed, ref, useId } from 'vue'\nimport { colorClass, textColorClasses } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Input from '../ui/Input.vue'\nimport { useCellUpdate, type CellProps } from './cell-update'\n\nconst props = defineProps<CellProps>()\nconst schema = computed(() => props.column as TextInputColumnSchema)\nconst { update, saving, error } = useCellUpdate(props)\nconst errorId = useId()\n// The saved value: follows the cell after the table reloads, so changing the input back to\n// an earlier value is saved too.\nconst initial = computed(() =>\n props.cell.state === null || props.cell.state === undefined ? '' : String(props.cell.state),\n)\nconst value = ref(initial.value)\n// `prefix()` / `suffix()`: text affixes around the input, like the TextInput field.\nconst grouped = computed(() => Boolean(props.cell.prefix || props.cell.suffix))\n</script>\n\n<template>\n <span @click.stop>\n <span\n :data-slot=\"grouped ? 'input-group' : undefined\"\n :class=\"\n grouped\n ? cn(\n 'border-input dark:bg-input/30 has-[input:focus-visible]:border-ring has-[input:focus-visible]:ring-ring/50 flex h-8 min-w-32 items-stretch overflow-hidden rounded-md border shadow-xs has-[input:focus-visible]:ring-[3px]',\n error && 'border-destructive',\n )\n : 'contents'\n \"\n >\n <span\n v-if=\"props.cell.prefix\"\n data-slot=\"input-prefix\"\n class=\"text-muted-foreground bg-muted/50 flex items-center border-e px-2 text-sm\"\n >{{ props.cell.prefix }}</span\n >\n <span :class=\"cn('relative block', grouped && 'min-w-0 flex-1')\">\n <span\n v-if=\"schema.prefixIcon\"\n data-slot=\"input-prefix-icon\"\n aria-hidden=\"true\"\n :class=\"\n cn(\n 'pointer-events-none absolute start-2.5 top-1/2 flex -translate-y-1/2',\n colorClass(textColorClasses, schema.prefixIconColor, 'gray'),\n )\n \"\n >\n <Icon :name=\"schema.prefixIcon\" class=\"size-4\" />\n </span>\n <Input\n :type=\"schema.inputType\"\n :model-value=\"value\"\n :placeholder=\"schema.placeholder\"\n :step=\"schema.step\"\n :inputmode=\"schema.inputMode\"\n :disabled=\"Boolean(props.cell.disabled) || saving\"\n :aria-label=\"props.column.label || props.column.name\"\n :aria-invalid=\"error ? true : undefined\"\n :aria-describedby=\"error ? errorId : undefined\"\n :class=\"\n cn(\n 'h-8 min-w-32',\n schema.prefixIcon && 'ps-8',\n schema.suffixIcon && 'pe-8',\n grouped &&\n 'h-full rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent',\n )\n \"\n @update:model-value=\"value = $event\"\n @blur=\"value !== initial && void update(value)\"\n @keydown.enter=\"($event.target as HTMLInputElement).blur()\"\n />\n <span\n v-if=\"schema.suffixIcon\"\n data-slot=\"input-suffix-icon\"\n aria-hidden=\"true\"\n :class=\"\n cn(\n 'pointer-events-none absolute end-2.5 top-1/2 flex -translate-y-1/2',\n colorClass(textColorClasses, schema.suffixIconColor, 'gray'),\n )\n \"\n >\n <Icon :name=\"schema.suffixIcon\" class=\"size-4\" />\n </span>\n </span>\n <span\n v-if=\"props.cell.suffix\"\n data-slot=\"input-suffix\"\n class=\"text-muted-foreground bg-muted/50 flex items-center border-s px-2 text-sm\"\n >{{ props.cell.suffix }}</span\n >\n </span>\n <span v-if=\"error\" :id=\"errorId\" class=\"text-destructive block text-xs\">{{ error }}</span>\n </span>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputCell.vue.d.ts","sourceRoot":"","sources":["../../../src/components/table/TextInputCell.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextInputCell.vue.d.ts","sourceRoot":"","sources":["../../../src/components/table/TextInputCell.vue"],"names":[],"mappings":"AA+GA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAA;;AA+N7D,wBAMG"}
|
|
@@ -3,20 +3,17 @@ import { colorClass as t, textColorClasses as n } from "../../lib/colors.js";
|
|
|
3
3
|
import r from "../../lib/Icon.js";
|
|
4
4
|
import i from "../ui/Input.js";
|
|
5
5
|
import { useCellUpdate as a } from "./cell-update.js";
|
|
6
|
-
import { computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, ref as m, toDisplayString as h, unref as g,
|
|
6
|
+
import { computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, ref as m, toDisplayString as h, unref as g, useId as _, withKeys as v, withModifiers as y } from "vue";
|
|
7
7
|
//#region src/components/table/TextInputCell.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
8
|
+
var b = ["data-slot"], x = {
|
|
9
9
|
key: 0,
|
|
10
10
|
"data-slot": "input-prefix",
|
|
11
11
|
class: "text-muted-foreground bg-muted/50 flex items-center border-e px-2 text-sm"
|
|
12
|
-
},
|
|
12
|
+
}, S = {
|
|
13
13
|
key: 1,
|
|
14
14
|
"data-slot": "input-suffix",
|
|
15
15
|
class: "text-muted-foreground bg-muted/50 flex items-center border-s px-2 text-sm"
|
|
16
|
-
},
|
|
17
|
-
key: 0,
|
|
18
|
-
class: "text-destructive block text-xs"
|
|
19
|
-
}, C = /*@__PURE__*/ d({
|
|
16
|
+
}, C = ["id"], w = /*@__PURE__*/ d({
|
|
20
17
|
__name: "TextInputCell",
|
|
21
18
|
props: {
|
|
22
19
|
column: {},
|
|
@@ -26,34 +23,36 @@ var y = ["data-slot"], b = {
|
|
|
26
23
|
component: {}
|
|
27
24
|
},
|
|
28
25
|
setup(d) {
|
|
29
|
-
let
|
|
30
|
-
return (a, o) => (p(), c("span", { onClick: o[3] ||=
|
|
31
|
-
"data-slot":
|
|
32
|
-
class: f(
|
|
26
|
+
let w = d, T = o(() => w.column), { update: E, saving: D, error: O } = a(w), k = _(), A = o(() => w.cell.state === null || w.cell.state === void 0 ? "" : String(w.cell.state)), j = m(A.value), M = o(() => !!(w.cell.prefix || w.cell.suffix));
|
|
27
|
+
return (a, o) => (p(), c("span", { onClick: o[3] ||= y(() => {}, ["stop"]) }, [l("span", {
|
|
28
|
+
"data-slot": M.value ? "input-group" : void 0,
|
|
29
|
+
class: f(M.value ? g(e)("border-input dark:bg-input/30 has-[input:focus-visible]:border-ring has-[input:focus-visible]:ring-ring/50 flex h-8 min-w-32 items-stretch overflow-hidden rounded-md border shadow-xs has-[input:focus-visible]:ring-[3px]", g(O) && "border-destructive") : "contents")
|
|
33
30
|
}, [
|
|
34
|
-
|
|
35
|
-
l("span", { class: f(g(e)("relative block",
|
|
36
|
-
|
|
31
|
+
w.cell.prefix ? (p(), c("span", x, h(w.cell.prefix), 1)) : s("", !0),
|
|
32
|
+
l("span", { class: f(g(e)("relative block", M.value && "min-w-0 flex-1")) }, [
|
|
33
|
+
T.value.prefixIcon ? (p(), c("span", {
|
|
37
34
|
key: 0,
|
|
38
35
|
"data-slot": "input-prefix-icon",
|
|
39
36
|
"aria-hidden": "true",
|
|
40
|
-
class: f(g(e)("pointer-events-none absolute start-2.5 top-1/2 flex -translate-y-1/2", g(t)(g(n),
|
|
37
|
+
class: f(g(e)("pointer-events-none absolute start-2.5 top-1/2 flex -translate-y-1/2", g(t)(g(n), T.value.prefixIconColor, "gray")))
|
|
41
38
|
}, [u(g(r), {
|
|
42
|
-
name:
|
|
39
|
+
name: T.value.prefixIcon,
|
|
43
40
|
class: "size-4"
|
|
44
41
|
}, null, 8, ["name"])], 2)) : s("", !0),
|
|
45
42
|
u(i, {
|
|
46
|
-
type:
|
|
47
|
-
"model-value":
|
|
48
|
-
placeholder:
|
|
49
|
-
step:
|
|
50
|
-
inputmode:
|
|
51
|
-
disabled: !!
|
|
52
|
-
"aria-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
type: T.value.inputType,
|
|
44
|
+
"model-value": j.value,
|
|
45
|
+
placeholder: T.value.placeholder,
|
|
46
|
+
step: T.value.step,
|
|
47
|
+
inputmode: T.value.inputMode,
|
|
48
|
+
disabled: !!w.cell.disabled || g(D),
|
|
49
|
+
"aria-label": w.column.label || w.column.name,
|
|
50
|
+
"aria-invalid": g(O) ? !0 : void 0,
|
|
51
|
+
"aria-describedby": g(O) ? g(k) : void 0,
|
|
52
|
+
class: f(g(e)("h-8 min-w-32", T.value.prefixIcon && "ps-8", T.value.suffixIcon && "pe-8", M.value && "h-full rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent")),
|
|
53
|
+
"onUpdate:modelValue": o[0] ||= (e) => j.value = e,
|
|
54
|
+
onBlur: o[1] ||= (e) => j.value !== A.value && void g(E)(j.value),
|
|
55
|
+
onKeydown: o[2] ||= v((e) => e.target.blur(), ["enter"])
|
|
57
56
|
}, null, 8, [
|
|
58
57
|
"type",
|
|
59
58
|
"model-value",
|
|
@@ -61,24 +60,30 @@ var y = ["data-slot"], b = {
|
|
|
61
60
|
"step",
|
|
62
61
|
"inputmode",
|
|
63
62
|
"disabled",
|
|
63
|
+
"aria-label",
|
|
64
64
|
"aria-invalid",
|
|
65
|
+
"aria-describedby",
|
|
65
66
|
"class"
|
|
66
67
|
]),
|
|
67
|
-
|
|
68
|
+
T.value.suffixIcon ? (p(), c("span", {
|
|
68
69
|
key: 1,
|
|
69
70
|
"data-slot": "input-suffix-icon",
|
|
70
71
|
"aria-hidden": "true",
|
|
71
|
-
class: f(g(e)("pointer-events-none absolute end-2.5 top-1/2 flex -translate-y-1/2", g(t)(g(n),
|
|
72
|
+
class: f(g(e)("pointer-events-none absolute end-2.5 top-1/2 flex -translate-y-1/2", g(t)(g(n), T.value.suffixIconColor, "gray")))
|
|
72
73
|
}, [u(g(r), {
|
|
73
|
-
name:
|
|
74
|
+
name: T.value.suffixIcon,
|
|
74
75
|
class: "size-4"
|
|
75
76
|
}, null, 8, ["name"])], 2)) : s("", !0)
|
|
76
77
|
], 2),
|
|
77
|
-
|
|
78
|
-
], 10,
|
|
78
|
+
w.cell.suffix ? (p(), c("span", S, h(w.cell.suffix), 1)) : s("", !0)
|
|
79
|
+
], 10, b), g(O) ? (p(), c("span", {
|
|
80
|
+
key: 0,
|
|
81
|
+
id: g(k),
|
|
82
|
+
class: "text-destructive block text-xs"
|
|
83
|
+
}, h(g(O)), 9, C)) : s("", !0)]));
|
|
79
84
|
}
|
|
80
85
|
});
|
|
81
86
|
//#endregion
|
|
82
|
-
export {
|
|
87
|
+
export { w as default };
|
|
83
88
|
|
|
84
89
|
//# sourceMappingURL=TextInputCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_withModifiers","_createElementVNode","_normalizeClass","_unref","_toDisplayString","_createCommentVNode","_createVNode","Icon","Input","_withKeys","Icon_default","Input_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","TextInputCell_vue_vue_type_script_setup_true_lang_default","props","__props","schema","computed","useCellUpdate","initial","value","ref","grouped","openBlock","createElementBlock","_cache","withModifiers","createElementVNode","normalizeClass","unref","cn","error","toDisplayString","createCommentVNode","colorClass","textColorClasses","createVNode","saving","$event","update","withKeys"],"sources":["../../../src/components/table/TextInputCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { TextInputColumnSchema } from '@alfakit/core'\nimport { computed, ref } from 'vue'\nimport { colorClass, textColorClasses } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Input from '../ui/Input.vue'\nimport { useCellUpdate, type CellProps } from './cell-update'\n\nconst props = defineProps<CellProps>()\nconst schema = computed(() => props.column as TextInputColumnSchema)\nconst { update, saving, error } = useCellUpdate(props)\nconst initial
|
|
1
|
+
{"version":3,"file":"TextInputCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_withModifiers","_createElementVNode","_normalizeClass","_unref","_toDisplayString","_createCommentVNode","_createVNode","Icon","Input","_withKeys","Icon_default","Input_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","TextInputCell_vue_vue_type_script_setup_true_lang_default","props","__props","schema","computed","useCellUpdate","errorId","useId","initial","value","ref","grouped","openBlock","createElementBlock","_cache","withModifiers","createElementVNode","normalizeClass","unref","cn","error","toDisplayString","createCommentVNode","colorClass","textColorClasses","createVNode","saving","$event","update","withKeys"],"sources":["../../../src/components/table/TextInputCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { TextInputColumnSchema } from '@alfakit/core'\nimport { computed, ref, useId } from 'vue'\nimport { colorClass, textColorClasses } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Input from '../ui/Input.vue'\nimport { useCellUpdate, type CellProps } from './cell-update'\n\nconst props = defineProps<CellProps>()\nconst schema = computed(() => props.column as TextInputColumnSchema)\nconst { update, saving, error } = useCellUpdate(props)\nconst errorId = useId()\n// The saved value: follows the cell after the table reloads, so changing the input back to\n// an earlier value is saved too.\nconst initial = computed(() =>\n props.cell.state === null || props.cell.state === undefined ? '' : String(props.cell.state),\n)\nconst value = ref(initial.value)\n// `prefix()` / `suffix()`: text affixes around the input, like the TextInput field.\nconst grouped = computed(() => Boolean(props.cell.prefix || props.cell.suffix))\n</script>\n\n<template>\n <span @click.stop>\n <span\n :data-slot=\"grouped ? 'input-group' : undefined\"\n :class=\"\n grouped\n ? cn(\n 'border-input dark:bg-input/30 has-[input:focus-visible]:border-ring has-[input:focus-visible]:ring-ring/50 flex h-8 min-w-32 items-stretch overflow-hidden rounded-md border shadow-xs has-[input:focus-visible]:ring-[3px]',\n error && 'border-destructive',\n )\n : 'contents'\n \"\n >\n <span\n v-if=\"props.cell.prefix\"\n data-slot=\"input-prefix\"\n class=\"text-muted-foreground bg-muted/50 flex items-center border-e px-2 text-sm\"\n >{{ props.cell.prefix }}</span\n >\n <span :class=\"cn('relative block', grouped && 'min-w-0 flex-1')\">\n <span\n v-if=\"schema.prefixIcon\"\n data-slot=\"input-prefix-icon\"\n aria-hidden=\"true\"\n :class=\"\n cn(\n 'pointer-events-none absolute start-2.5 top-1/2 flex -translate-y-1/2',\n colorClass(textColorClasses, schema.prefixIconColor, 'gray'),\n )\n \"\n >\n <Icon :name=\"schema.prefixIcon\" class=\"size-4\" />\n </span>\n <Input\n :type=\"schema.inputType\"\n :model-value=\"value\"\n :placeholder=\"schema.placeholder\"\n :step=\"schema.step\"\n :inputmode=\"schema.inputMode\"\n :disabled=\"Boolean(props.cell.disabled) || saving\"\n :aria-label=\"props.column.label || props.column.name\"\n :aria-invalid=\"error ? true : undefined\"\n :aria-describedby=\"error ? errorId : undefined\"\n :class=\"\n cn(\n 'h-8 min-w-32',\n schema.prefixIcon && 'ps-8',\n schema.suffixIcon && 'pe-8',\n grouped &&\n 'h-full rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent',\n )\n \"\n @update:model-value=\"value = $event\"\n @blur=\"value !== initial && void update(value)\"\n @keydown.enter=\"($event.target as HTMLInputElement).blur()\"\n />\n <span\n v-if=\"schema.suffixIcon\"\n data-slot=\"input-suffix-icon\"\n aria-hidden=\"true\"\n :class=\"\n cn(\n 'pointer-events-none absolute end-2.5 top-1/2 flex -translate-y-1/2',\n colorClass(textColorClasses, schema.suffixIconColor, 'gray'),\n )\n \"\n >\n <Icon :name=\"schema.suffixIcon\" class=\"size-4\" />\n </span>\n </span>\n <span\n v-if=\"props.cell.suffix\"\n data-slot=\"input-suffix\"\n class=\"text-muted-foreground bg-muted/50 flex items-center border-s px-2 text-sm\"\n >{{ props.cell.suffix }}</span\n >\n </span>\n <span v-if=\"error\" :id=\"errorId\" class=\"text-destructive block text-xs\">{{ error }}</span>\n </span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EASA,IAAMmB,IAAQC,GACRC,IAASC,QAAeH,EAAM,MAA+B,GAC7D,EAAE,WAAQ,WAAQ,aAAUI,EAAcJ,CAAK,GAC/CK,IAAUC,EAAM,GAGhBC,IAAUJ,QACdH,EAAM,KAAK,UAAU,QAAQA,EAAM,KAAK,UAAU,KAAA,IAAY,KAAK,OAAOA,EAAM,KAAK,KAAK,CAC5F,GACMQ,IAAQC,EAAIF,EAAQ,KAAK,GAEzBG,IAAUP,QAAe,GAAQH,EAAM,KAAK,UAAUA,EAAM,KAAK,OAAO;oBAI5EnB,EAAA,GAAAC,EA6EO,QAAA,EA7EA,SAAK,AAAA+B,EAAA,OAAA9B,QAAN,CAAA,GAAW,CAAA,MAAA,CAAA,EAAA,GAAA,CACfC,EA0EO,QAAA;GAzEJ,aAAW0B,EAAA,QAAO,gBAAmB,KAAA;GACrC,OAAKzB,EAAWyB,EAAA,QAAoBxB,EAAAgC,CAAA,CAAE,CAAA,+NAA6PhC,EAAAiC,CAAA,KAAK,oBAAA,IAAA,UAAA;;GAUjSnB,EAAM,KAAK,UADnBnB,EAAA,GAAAC,EAKC,QALDc,GAKCT,EADKa,EAAM,KAAK,MAAM,GAAA,CAAA,KAAAqB,EAAA,IAAA,EAAA;GAEvBrC,EAkDO,QAAA,EAlDA,OAAKC,EAAEC,EAAAgC,CAAA,CAAE,CAAA,kBAAmBR,EAAA,SAAO,gBAAA,CAAA,EAAA,GAAA;IAEhCR,EAAA,MAAO,cADfrB,EAAA,GAAAC,EAYO,QAAA;;KAVL,aAAU;KACV,eAAY;KACX,OAAKG,EAAeC,EAAAgC,CAAA,CAAE,CAAA,wEAAsGhC,EAAAoC,CAAA,CAAU,CAACpC,EAAAqC,CAAA,GAAkBrB,EAAA,MAAO,iBAAe,MAAA,CAAA,CAAA;IAOhLb,GAAAA,CAAAA,EAAiDH,EAAAI,CAAA,GAAA;KAA1C,MAAMY,EAAA,MAAO;KAAY,OAAM;;IAExCb,EAsBEE,GAAA;KArBC,MAAMW,EAAA,MAAO;KACb,eAAaM,EAAA;KACb,aAAaN,EAAA,MAAO;KACpB,MAAMA,EAAA,MAAO;KACb,WAAWA,EAAA,MAAO;KAClB,UAAU,EAAQF,EAAM,KAAK,YAAad,EAAAuC,CAAA;KAC1C,cAAYzB,EAAM,OAAO,SAASA,EAAM,OAAO;KAC/C,gBAAcd,EAAAiC,CAAA,IAAK,KAAU,KAAA;KAC7B,oBAAkBjC,EAAAiC,CAAA,IAAQjC,EAAAmB,CAAA,IAAU,KAAA;KACpC,OAAKpB,EAAeC,EAAAgC,CAAA,CAAE,CAAA,gBAA8ChB,EAAA,MAAO,cAAU,QAA0BA,EAAA,MAAO,cAAU,QAA0BQ,EAAA,SAAA,kGAAA,CAAA;KAS1J,uBAAkB,AAAAG,EAAA,QAAA,MAAE,EAAA,QAAQa;KAC5B,QAAI,AAAAb,EAAA,QAAA,MAAEL,EAAA,UAAUD,EAAA,SAAO,KAASrB,EAAAyC,CAAA,CAAM,CAACnB,EAAA,KAAK;KAC5C,WAAO,AAAAK,EAAA,OAAArB,GAAA,MAASkC,EAAO,OAA4B,KAAI,GAAA,CAAA,OAAA,CAAA;;;;;;;;;;;;;IAGlDxB,EAAA,MAAO,cADfrB,EAAA,GAAAC,EAYO,QAAA;;KAVL,aAAU;KACV,eAAY;KACX,OAAKG,EAAeC,EAAAgC,CAAA,CAAE,CAAA,sEAAoGhC,EAAAoC,CAAA,CAAU,CAACpC,EAAAqC,CAAA,GAAkBrB,EAAA,MAAO,iBAAe,MAAA,CAAA,CAAA;IAO9Kb,GAAAA,CAAAA,EAAiDH,EAAAI,CAAA,GAAA;KAA1C,MAAMY,EAAA,MAAO;KAAY,OAAM;;;GAIlCF,EAAM,KAAK,UADnBnB,EAAA,GAAAC,EAKC,QALDe,GAKCV,EADKa,EAAM,KAAK,MAAM,GAAA,CAAA,KAAAqB,EAAA,IAAA,EAAA;EAGbnC,GAAAA,IAAAA,CAAAA,GAAAA,EAAAiC,CAAA,KAAZtC,EAAA,GAAAC,EAA0F,QAAA;;GAAtE,IAAII,EAAAmB,CAAA;GAAS,OAAM;EAAoC,GAAAlB,EAAAD,EAAAiC,CAAA,CAAK,GAAA,GAAArB,CAAA,KAAAuB,EAAA,IAAA,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Component styles shared by panels (themes.css) and by Alfakit outside panels
|
|
3
|
+
* (standalone.css, starter-kit panels): chart colours, RichEditor columns, the calendar,
|
|
4
|
+
* tree and Kanban plugins, and field positioning. They read the theme tokens (`--primary`,
|
|
5
|
+
* `--border`…), whichever stylesheet defines them. Copied into each renderer's dist.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* ------------------------------------------------------------------ Charts */
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Chart.js paints axes, legends and tooltips on the canvas, so chart widgets read these
|
|
12
|
+
* properties from <html> (re-read when the theme or dark mode changes). Colours take any
|
|
13
|
+
* CSS colour; the widths and radius are unitless numbers. Override them in a theme:
|
|
14
|
+
* :root[data-alfakit-theme~='acme'] { --chart-tooltip-bg: oklch(0.2 0 0); }
|
|
15
|
+
* Stat sparklines (`[data-slot='stat-chart']`) use the `--stat-chart-*` properties.
|
|
16
|
+
*/
|
|
17
|
+
:root {
|
|
18
|
+
--chart-text: var(--muted-foreground);
|
|
19
|
+
--chart-grid: var(--border);
|
|
20
|
+
--chart-legend-foreground: var(--muted-foreground);
|
|
21
|
+
--chart-tooltip-bg: var(--popover);
|
|
22
|
+
--chart-tooltip-foreground: var(--popover-foreground);
|
|
23
|
+
--chart-tooltip-border: var(--border);
|
|
24
|
+
--chart-tooltip-border-width: 1;
|
|
25
|
+
--chart-tooltip-radius: 6;
|
|
26
|
+
--stat-chart-stroke-width: 2;
|
|
27
|
+
--stat-chart-fill-opacity: 0.12;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
* RichEditor `grid` column blocks and `lead` / `small` text, in the editor and in rendered
|
|
32
|
+
* content (`RichContentRenderer`). Columns stack on small screens. Stored as
|
|
33
|
+
* `<div data-type="grid" class="alfakit-grid alfakit-grid-cols-2"><div data-type="gridColumn">`
|
|
34
|
+
* and `<p class="alfakit-lead">`; copy these rules when showing content outside a panel.
|
|
35
|
+
*/
|
|
36
|
+
:where(.alfakit-grid) {
|
|
37
|
+
display: grid;
|
|
38
|
+
gap: 1rem;
|
|
39
|
+
grid-template-columns: minmax(0, 1fr);
|
|
40
|
+
margin-block: 0.5rem;
|
|
41
|
+
}
|
|
42
|
+
:where(.alfakit-grid-column) {
|
|
43
|
+
min-width: 0;
|
|
44
|
+
}
|
|
45
|
+
:where(.alfakit-grid-column) > :first-child {
|
|
46
|
+
margin-block-start: 0;
|
|
47
|
+
}
|
|
48
|
+
@media (min-width: 768px) {
|
|
49
|
+
:where(.alfakit-grid-cols-2) {
|
|
50
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
51
|
+
}
|
|
52
|
+
:where(.alfakit-grid-cols-3) {
|
|
53
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
54
|
+
}
|
|
55
|
+
:where(.alfakit-grid-cols-4) {
|
|
56
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
57
|
+
}
|
|
58
|
+
:where(.alfakit-grid-cols-5) {
|
|
59
|
+
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
60
|
+
}
|
|
61
|
+
:where(.alfakit-grid-cols-6) {
|
|
62
|
+
grid-template-columns: repeat(6, minmax(0, 1fr));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
:where([contenteditable] .alfakit-grid-column) {
|
|
66
|
+
border: 1px dashed var(--border);
|
|
67
|
+
border-radius: 0.375rem;
|
|
68
|
+
padding: 0.25rem 0.5rem;
|
|
69
|
+
}
|
|
70
|
+
:where(.alfakit-lead) {
|
|
71
|
+
font-size: 1.125em;
|
|
72
|
+
line-height: 1.6;
|
|
73
|
+
}
|
|
74
|
+
:where(.alfakit-prose small) {
|
|
75
|
+
font-size: 0.8125em;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* ---------------------------------------------------------- Calendar and tree */
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
* The calendar widget (alfasix/alfakit-calendar) draws FullCalendar inside
|
|
82
|
+
* `[data-slot="calendar"]`; FullCalendar reads these `--fc-*` variables, so every theme's
|
|
83
|
+
* tokens (and dark mode) apply. Override them on the slot to restyle one calendar.
|
|
84
|
+
*/
|
|
85
|
+
:where(.fc[data-slot='calendar']) {
|
|
86
|
+
--fc-small-font-size: 0.75rem;
|
|
87
|
+
--fc-page-bg-color: var(--card);
|
|
88
|
+
--fc-neutral-bg-color: var(--muted);
|
|
89
|
+
--fc-neutral-text-color: var(--muted-foreground);
|
|
90
|
+
--fc-border-color: var(--border);
|
|
91
|
+
--fc-button-text-color: var(--foreground);
|
|
92
|
+
--fc-button-bg-color: var(--background);
|
|
93
|
+
--fc-button-border-color: var(--border);
|
|
94
|
+
--fc-button-hover-bg-color: var(--accent);
|
|
95
|
+
--fc-button-hover-border-color: var(--border);
|
|
96
|
+
--fc-button-active-bg-color: var(--secondary);
|
|
97
|
+
--fc-button-active-border-color: var(--border);
|
|
98
|
+
--fc-event-bg-color: var(--primary);
|
|
99
|
+
--fc-event-border-color: var(--primary);
|
|
100
|
+
--fc-event-text-color: var(--primary-foreground);
|
|
101
|
+
--fc-event-selected-overlay-color: color-mix(in oklab, var(--foreground) 25%, transparent);
|
|
102
|
+
--fc-more-link-bg-color: var(--muted);
|
|
103
|
+
--fc-more-link-text-color: var(--foreground);
|
|
104
|
+
--fc-non-business-color: color-mix(in oklab, var(--muted) 60%, transparent);
|
|
105
|
+
--fc-bg-event-color: var(--primary);
|
|
106
|
+
--fc-bg-event-opacity: 0.2;
|
|
107
|
+
--fc-highlight-color: color-mix(in oklab, var(--primary) 15%, transparent);
|
|
108
|
+
--fc-today-bg-color: color-mix(in oklab, var(--primary) 6%, transparent);
|
|
109
|
+
--fc-now-indicator-color: var(--destructive);
|
|
110
|
+
--fc-list-event-hover-bg-color: var(--accent);
|
|
111
|
+
color: var(--card-foreground);
|
|
112
|
+
}
|
|
113
|
+
/*
|
|
114
|
+
* FullCalendar puts its `fc` class on the slot element itself and injects its own CSS
|
|
115
|
+
* (`.fc .fc-button`, two classes), so these rules are plain selectors anchored on
|
|
116
|
+
* `.fc[data-slot='calendar']` (three) rather than `:where()`, which would always lose.
|
|
117
|
+
* Restyle one calendar with a more specific selector or with the `--fc-*` variables.
|
|
118
|
+
*/
|
|
119
|
+
.fc[data-slot='calendar'] .fc-toolbar-title {
|
|
120
|
+
font-size: 1.125rem;
|
|
121
|
+
font-weight: 600;
|
|
122
|
+
line-height: 1.75rem;
|
|
123
|
+
color: var(--foreground);
|
|
124
|
+
}
|
|
125
|
+
.fc[data-slot='calendar'] .fc-button {
|
|
126
|
+
display: inline-flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
min-height: 2.25rem;
|
|
130
|
+
padding: 0.375rem 0.75rem;
|
|
131
|
+
border-radius: var(--radius);
|
|
132
|
+
font-size: 0.875rem;
|
|
133
|
+
font-weight: 500;
|
|
134
|
+
line-height: 1.25rem;
|
|
135
|
+
box-shadow: none;
|
|
136
|
+
text-transform: capitalize;
|
|
137
|
+
}
|
|
138
|
+
.fc[data-slot='calendar'] .fc-button .fc-icon {
|
|
139
|
+
font-size: 1.125rem;
|
|
140
|
+
}
|
|
141
|
+
.fc[data-slot='calendar'] .fc-button-group > .fc-button:not(:first-child) {
|
|
142
|
+
border-start-start-radius: 0;
|
|
143
|
+
border-end-start-radius: 0;
|
|
144
|
+
}
|
|
145
|
+
.fc[data-slot='calendar'] .fc-button-group > .fc-button:not(:last-child) {
|
|
146
|
+
border-start-end-radius: 0;
|
|
147
|
+
border-end-end-radius: 0;
|
|
148
|
+
}
|
|
149
|
+
.fc[data-slot='calendar'] .fc-button-primary:disabled {
|
|
150
|
+
opacity: 0.5;
|
|
151
|
+
}
|
|
152
|
+
.fc[data-slot='calendar'] .fc-button-primary:not(:disabled).fc-button-active,
|
|
153
|
+
.fc[data-slot='calendar'] .fc-button-primary:not(:disabled):active {
|
|
154
|
+
color: var(--secondary-foreground);
|
|
155
|
+
}
|
|
156
|
+
.fc[data-slot='calendar'] .fc-button-primary:focus,
|
|
157
|
+
.fc[data-slot='calendar'] .fc-button-primary:not(:disabled).fc-button-active:focus,
|
|
158
|
+
.fc[data-slot='calendar'] .fc-button-primary:not(:disabled):active:focus {
|
|
159
|
+
box-shadow: none;
|
|
160
|
+
}
|
|
161
|
+
.fc[data-slot='calendar'] .fc-button:focus-visible {
|
|
162
|
+
outline: 2px solid var(--ring);
|
|
163
|
+
outline-offset: 2px;
|
|
164
|
+
z-index: 2;
|
|
165
|
+
}
|
|
166
|
+
.fc[data-slot='calendar'] a {
|
|
167
|
+
color: inherit;
|
|
168
|
+
}
|
|
169
|
+
.fc[data-slot='calendar'] .fc-daygrid-day-number,
|
|
170
|
+
.fc[data-slot='calendar'] .fc-col-header-cell-cushion {
|
|
171
|
+
text-decoration: none;
|
|
172
|
+
}
|
|
173
|
+
.fc[data-slot='calendar'] .fc-col-header-cell-cushion {
|
|
174
|
+
padding-block: 0.375rem;
|
|
175
|
+
font-size: 0.75rem;
|
|
176
|
+
font-weight: 500;
|
|
177
|
+
color: var(--muted-foreground);
|
|
178
|
+
}
|
|
179
|
+
.fc[data-slot='calendar'] .fc-daygrid-day-number {
|
|
180
|
+
font-size: 0.875rem;
|
|
181
|
+
}
|
|
182
|
+
.fc[data-slot='calendar'] .fc-day-other .fc-daygrid-day-number {
|
|
183
|
+
color: var(--muted-foreground);
|
|
184
|
+
}
|
|
185
|
+
/* Today: a tinted cell (`--fc-today-bg-color`) and the date in a primary pill. */
|
|
186
|
+
.fc[data-slot='calendar'] .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
|
|
187
|
+
display: inline-flex;
|
|
188
|
+
align-items: center;
|
|
189
|
+
justify-content: center;
|
|
190
|
+
min-width: 1.75rem;
|
|
191
|
+
height: 1.75rem;
|
|
192
|
+
margin: 0.25rem;
|
|
193
|
+
padding: 0 0.375rem;
|
|
194
|
+
border-radius: 9999px;
|
|
195
|
+
background: var(--primary);
|
|
196
|
+
color: var(--primary-foreground);
|
|
197
|
+
font-weight: 600;
|
|
198
|
+
}
|
|
199
|
+
.fc[data-slot='calendar'] .fc-col-header-cell.fc-day-today .fc-col-header-cell-cushion {
|
|
200
|
+
color: var(--primary);
|
|
201
|
+
font-weight: 600;
|
|
202
|
+
}
|
|
203
|
+
.fc[data-slot='calendar'] .fc-event {
|
|
204
|
+
border-radius: min(var(--radius), 0.375rem);
|
|
205
|
+
}
|
|
206
|
+
.fc[data-slot='calendar'] .fc-daygrid-event,
|
|
207
|
+
.fc[data-slot='calendar'] .fc-timegrid-event .fc-event-main,
|
|
208
|
+
.fc[data-slot='calendar'] .fc-list-event td {
|
|
209
|
+
font-size: 0.75rem;
|
|
210
|
+
}
|
|
211
|
+
/* Clipped titles keep their beginning and end with an ellipsis, also a Latin title in a
|
|
212
|
+
right-to-left calendar (its direction follows its own text). */
|
|
213
|
+
.fc[data-slot='calendar'] .fc-event-title {
|
|
214
|
+
text-overflow: ellipsis;
|
|
215
|
+
unicode-bidi: plaintext;
|
|
216
|
+
text-align: start;
|
|
217
|
+
}
|
|
218
|
+
.fc[data-slot='calendar'] .fc-daygrid-dot-event:hover,
|
|
219
|
+
.fc[data-slot='calendar'] .fc-daygrid-dot-event.fc-event-mirror {
|
|
220
|
+
background: var(--accent);
|
|
221
|
+
}
|
|
222
|
+
.fc[data-slot='calendar'] .fc-list-day-cushion,
|
|
223
|
+
.fc[data-slot='calendar'] .fc-popover-header {
|
|
224
|
+
color: var(--foreground);
|
|
225
|
+
}
|
|
226
|
+
.fc[data-slot='calendar'] .fc-popover {
|
|
227
|
+
border-radius: var(--radius);
|
|
228
|
+
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
229
|
+
overflow: hidden;
|
|
230
|
+
}
|
|
231
|
+
.fc[data-slot='calendar'] .fc-timegrid-slot-label,
|
|
232
|
+
.fc[data-slot='calendar'] .fc-timegrid-axis,
|
|
233
|
+
.fc[data-slot='calendar'] .fc-list-event-time {
|
|
234
|
+
color: var(--muted-foreground);
|
|
235
|
+
font-size: 0.75rem;
|
|
236
|
+
}
|
|
237
|
+
/*
|
|
238
|
+
* The list view hides its column headers for screen readers with `left: -10000px`. Right to
|
|
239
|
+
* left that is scrollable overflow: the whole page gains a 10 000 px horizontal scroll and the
|
|
240
|
+
* top bar slides under the sidebar. Clip it in place instead (still read by screen readers).
|
|
241
|
+
*/
|
|
242
|
+
.fc[data-slot='calendar'] .fc-list-table thead {
|
|
243
|
+
left: auto;
|
|
244
|
+
inset-inline-start: 0;
|
|
245
|
+
width: 1px;
|
|
246
|
+
height: 1px;
|
|
247
|
+
overflow: hidden;
|
|
248
|
+
clip-path: inset(50%);
|
|
249
|
+
white-space: nowrap;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/*
|
|
253
|
+
* Fields contain what they position. Headless switches, checkboxes and radios render a
|
|
254
|
+
* visually hidden native input beside the control, absolutely positioned (and shifted by
|
|
255
|
+
* -100%); without a positioned field it lands at the page edge and, right to left, widens
|
|
256
|
+
* the page on phones.
|
|
257
|
+
*/
|
|
258
|
+
:where([data-slot='field']) {
|
|
259
|
+
position: relative;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/*
|
|
263
|
+
* Narrow screens: FullCalendar keeps its header toolbar on one row, wider than a phone.
|
|
264
|
+
* Its chunks (navigation, title, views) wrap instead, and the title shrinks. Flex gaps and
|
|
265
|
+
* `justify-content` follow the writing direction, so this works right to left too. (Plain
|
|
266
|
+
* selectors: FullCalendar injects its own CSS, which would beat `:where()`; the slot is
|
|
267
|
+
* the `.fc` element itself.)
|
|
268
|
+
*/
|
|
269
|
+
@media (max-width: 39.99rem) {
|
|
270
|
+
[data-slot='calendar'] .fc-toolbar.fc-header-toolbar {
|
|
271
|
+
flex-wrap: wrap;
|
|
272
|
+
gap: 0.5rem;
|
|
273
|
+
}
|
|
274
|
+
[data-slot='calendar'] .fc-toolbar .fc-toolbar-chunk {
|
|
275
|
+
display: flex;
|
|
276
|
+
flex-wrap: wrap;
|
|
277
|
+
align-items: center;
|
|
278
|
+
gap: 0.25rem;
|
|
279
|
+
min-width: 0;
|
|
280
|
+
}
|
|
281
|
+
[data-slot='calendar'] .fc-toolbar .fc-toolbar-title {
|
|
282
|
+
font-size: 1rem;
|
|
283
|
+
overflow-wrap: anywhere;
|
|
284
|
+
}
|
|
285
|
+
[data-slot='calendar'] .fc-toolbar .fc-button {
|
|
286
|
+
font-size: 0.8125rem;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/*
|
|
291
|
+
* The tree (alfasix/alfakit-tree): the drop indicator while dragging. Rows carry
|
|
292
|
+
* `data-drop="before|after|inside"`; lines are drawn above or below the row, so they
|
|
293
|
+
* need no direction.
|
|
294
|
+
*/
|
|
295
|
+
:where([data-slot='tree-item'][data-drop='before']) {
|
|
296
|
+
box-shadow: inset 0 2px 0 0 var(--primary);
|
|
297
|
+
}
|
|
298
|
+
:where([data-slot='tree-item'][data-drop='after']) {
|
|
299
|
+
box-shadow: inset 0 -2px 0 0 var(--primary);
|
|
300
|
+
}
|
|
301
|
+
:where([data-slot='tree-item'][data-drop='inside']) {
|
|
302
|
+
background-color: color-mix(in oklab, var(--primary) 10%, transparent);
|
|
303
|
+
outline: 1px dashed var(--primary);
|
|
304
|
+
outline-offset: -1px;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/*
|
|
308
|
+
* The Kanban board (alfasix/alfakit-kanban). A card being dragged leaves a dashed
|
|
309
|
+
* placeholder (`data-picked="pointer"`) while a copy follows the pointer
|
|
310
|
+
* (`data-slot="kanban-ghost"`); a card picked up with the keyboard is lifted
|
|
311
|
+
* (`data-picked="keyboard"`). A list the picked card may not enter has `data-refused`.
|
|
312
|
+
*/
|
|
313
|
+
:where([data-slot='kanban-card'][data-picked='pointer']) {
|
|
314
|
+
opacity: 0.45;
|
|
315
|
+
}
|
|
316
|
+
:where([data-slot='kanban-card'][data-picked='pointer'] > [data-slot='kanban-card-body']) {
|
|
317
|
+
border-style: dashed;
|
|
318
|
+
box-shadow: none;
|
|
319
|
+
}
|
|
320
|
+
:where([data-slot='kanban-card'][data-picked='keyboard'] > [data-slot='kanban-card-body']) {
|
|
321
|
+
outline: 2px solid var(--primary);
|
|
322
|
+
outline-offset: 2px;
|
|
323
|
+
box-shadow: 0 10px 24px -12px color-mix(in oklab, var(--foreground) 45%, transparent);
|
|
324
|
+
}
|
|
325
|
+
:where([data-slot='kanban-card'][data-saving]) {
|
|
326
|
+
opacity: 0.7;
|
|
327
|
+
}
|
|
328
|
+
:where([data-slot='kanban-ghost']) {
|
|
329
|
+
cursor: grabbing;
|
|
330
|
+
list-style: none;
|
|
331
|
+
box-shadow: 0 18px 40px -16px color-mix(in oklab, var(--foreground) 55%, transparent);
|
|
332
|
+
}
|
|
333
|
+
:where([data-slot='kanban-dropzone'][data-refused]) {
|
|
334
|
+
background-color: color-mix(in oklab, var(--destructive) 8%, transparent);
|
|
335
|
+
outline: 1px dashed var(--destructive);
|
|
336
|
+
outline-offset: -1px;
|
|
337
|
+
}
|
|
338
|
+
:where(body[data-kanban-dragging]) {
|
|
339
|
+
cursor: grabbing;
|
|
340
|
+
user-select: none;
|
|
341
|
+
-webkit-user-select: none;
|
|
342
|
+
}
|
|
343
|
+
@media (prefers-reduced-motion: reduce) {
|
|
344
|
+
:where([data-slot='kanban-card'] > [data-slot='kanban-card-body']) {
|
|
345
|
+
transition: none;
|
|
346
|
+
}
|
|
347
|
+
}
|