@rotki/ui-library 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordions/accordion/RuiAccordion.js.map +1 -1
- package/dist/components/accordions/accordion/RuiAccordion.vue_vue_type_script_setup_true_lang.js +13 -2
- package/dist/components/accordions/accordion/RuiAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/alerts/RuiAlert.vue.d.ts +2 -2
- package/dist/components/buttons/button/RuiButton.js.map +1 -1
- package/dist/components/buttons/button/RuiButton.vue.d.ts +7 -1
- package/dist/components/buttons/button/RuiButton.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/components/buttons/button/RuiButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/buttons/button/button-props.d.ts +3 -0
- package/dist/components/buttons/button/button-props.js +2 -1
- package/dist/components/buttons/button/button-props.js.map +1 -1
- package/dist/components/buttons/button/button-styles.d.ts +75 -0
- package/dist/components/buttons/button/button-styles.js +135 -4
- package/dist/components/buttons/button/button-styles.js.map +1 -1
- package/dist/components/cards/RuiCard.js.map +1 -1
- package/dist/components/cards/RuiCard.vue.d.ts +6 -0
- package/dist/components/cards/RuiCard.vue_vue_type_script_setup_true_lang.js +14 -2
- package/dist/components/cards/RuiCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/chips/RuiChip.js.map +1 -1
- package/dist/components/chips/RuiChip.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/components/chips/RuiChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/chips/chip-props.d.ts +2 -0
- package/dist/components/chips/chip-props.js +3 -0
- package/dist/components/chips/chip-props.js.map +1 -1
- package/dist/components/color-picker/RuiColorInput.js.map +1 -1
- package/dist/components/color-picker/RuiColorInput.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/color-picker/RuiColorInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/date-time-picker/RuiDateTimePicker.js.map +1 -1
- package/dist/components/date-time-picker/RuiDateTimePicker.vue.d.ts +4 -0
- package/dist/components/date-time-picker/RuiDateTimePicker.vue_vue_type_script_setup_true_lang.js +6 -2
- package/dist/components/date-time-picker/RuiDateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/date-time-picker/RuiDateTimePickerMenu.js.map +1 -1
- package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/date-time-picker/RuiTimezoneSelect.js.map +1 -1
- package/dist/components/date-time-picker/RuiTimezoneSelect.vue.d.ts +4 -0
- package/dist/components/date-time-picker/RuiTimezoneSelect.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/date-time-picker/RuiTimezoneSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/auto-complete/RuiAutoComplete.js.map +1 -1
- package/dist/components/forms/auto-complete/RuiAutoComplete.vue_vue_type_script_setup_true_lang.js +6 -2
- package/dist/components/forms/auto-complete/RuiAutoComplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/auto-complete/auto-complete-props.d.ts +4 -0
- package/dist/components/forms/category-picker/RuiCategoryPicker.js.map +1 -1
- package/dist/components/forms/category-picker/RuiCategoryPicker.vue.d.ts +4 -1
- package/dist/components/forms/category-picker/RuiCategoryPicker.vue_vue_type_script_setup_true_lang.js +7 -4
- package/dist/components/forms/category-picker/RuiCategoryPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/check-control-styles.d.ts +27 -0
- package/dist/components/forms/check-control-styles.js +26 -1
- package/dist/components/forms/check-control-styles.js.map +1 -1
- package/dist/components/forms/checkbox/RuiCheckbox.js.map +1 -1
- package/dist/components/forms/checkbox/RuiCheckbox.vue.d.ts +6 -0
- package/dist/components/forms/checkbox/RuiCheckbox.vue_vue_type_script_setup_true_lang.js +14 -4
- package/dist/components/forms/checkbox/RuiCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/checkbox/checkbox-group/RuiCheckboxGroup.js.map +1 -1
- package/dist/components/forms/checkbox/checkbox-group/RuiCheckboxGroup.vue.d.ts +4 -0
- package/dist/components/forms/checkbox/checkbox-group/RuiCheckboxGroup.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/components/forms/checkbox/checkbox-group/RuiCheckboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/field-defaults/RuiFieldDefaults.js.map +1 -1
- package/dist/components/forms/field-defaults/RuiFieldDefaults.vue.d.ts +3 -0
- package/dist/components/forms/field-defaults/RuiFieldDefaults.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/components/forms/field-defaults/RuiFieldDefaults.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/file-upload/RuiFileUpload.js.map +1 -1
- package/dist/components/forms/file-upload/RuiFileUpload.vue.d.ts +4 -1
- package/dist/components/forms/file-upload/RuiFileUpload.vue_vue_type_script_setup_true_lang.js +10 -3
- package/dist/components/forms/file-upload/RuiFileUpload.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/radio-button/radio/RuiRadio.js.map +1 -1
- package/dist/components/forms/radio-button/radio/RuiRadio.vue.d.ts +6 -0
- package/dist/components/forms/radio-button/radio/RuiRadio.vue_vue_type_script_setup_true_lang.js +14 -3
- package/dist/components/forms/radio-button/radio/RuiRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.js.map +1 -1
- package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue.d.ts +4 -0
- package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/revealable-text-field/RuiRevealableTextField.js.map +1 -1
- package/dist/components/forms/revealable-text-field/RuiRevealableTextField.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/forms/revealable-text-field/RuiRevealableTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/select/RuiMenuSelect.js.map +1 -1
- package/dist/components/forms/select/RuiMenuSelect.vue.d.ts +4 -0
- package/dist/components/forms/select/RuiMenuSelect.vue_vue_type_script_setup_true_lang.js +6 -2
- package/dist/components/forms/select/RuiMenuSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/slider/RuiSlider.js.map +1 -1
- package/dist/components/forms/slider/RuiSlider.vue.d.ts +4 -0
- package/dist/components/forms/slider/RuiSlider.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/components/forms/slider/RuiSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/switch/RuiSwitch.js.map +1 -1
- package/dist/components/forms/switch/RuiSwitch.vue.d.ts +6 -0
- package/dist/components/forms/switch/RuiSwitch.vue_vue_type_script_setup_true_lang.js +25 -5
- package/dist/components/forms/switch/RuiSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/text-area/RuiTextArea.js.map +1 -1
- package/dist/components/forms/text-area/RuiTextArea.vue.d.ts +4 -0
- package/dist/components/forms/text-area/RuiTextArea.vue_vue_type_script_setup_true_lang.js +6 -4
- package/dist/components/forms/text-area/RuiTextArea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/text-area/text-area-styles.d.ts +0 -1
- package/dist/components/forms/text-area/text-area-styles.js +0 -1
- package/dist/components/forms/text-area/text-area-styles.js.map +1 -1
- package/dist/components/forms/text-field/RuiTextField.js.map +1 -1
- package/dist/components/forms/text-field/RuiTextField.vue.d.ts +6 -2
- package/dist/components/forms/text-field/RuiTextField.vue_vue_type_script_setup_true_lang.js +6 -4
- package/dist/components/forms/text-field/RuiTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/text-field/text-field-styles.d.ts +0 -1
- package/dist/components/forms/text-field/text-field-styles.js +0 -1
- package/dist/components/forms/text-field/text-field-styles.js.map +1 -1
- package/dist/components/helpers/RuiFormTextDetail.js.map +1 -1
- package/dist/components/helpers/RuiFormTextDetail.vue.d.ts +14 -0
- package/dist/components/helpers/RuiFormTextDetail.vue_vue_type_script_setup_true_lang.js +41 -11
- package/dist/components/helpers/RuiFormTextDetail.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/loaders/RuiSkeletonBase.js.map +1 -1
- package/dist/components/loaders/RuiSkeletonBase.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/overlays/menu/RuiMenu.js.map +1 -1
- package/dist/components/overlays/menu/RuiMenu.vue.d.ts +3 -0
- package/dist/components/overlays/menu/RuiMenu.vue_vue_type_script_setup_true_lang.js +9 -1
- package/dist/components/overlays/menu/RuiMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/RuiDataTable.js.map +1 -1
- package/dist/components/tables/RuiDataTable.vue.d.ts +4 -0
- package/dist/components/tables/RuiDataTable.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/components/tables/RuiDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/RuiExpandButton.js.map +1 -1
- package/dist/components/tables/RuiExpandButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/RuiTableHead.js.map +1 -1
- package/dist/components/tables/RuiTableHead.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/tables/RuiTableHead.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/RuiTablePagination.js.map +1 -1
- package/dist/components/tables/RuiTablePagination.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/tables/RuiTablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableAppendRow.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableAppendRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableRow.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableRow.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/tables/data-table/RuiDataTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/data-table-styles.d.ts +6 -0
- package/dist/components/tables/data-table-styles.js +11 -3
- package/dist/components/tables/data-table-styles.js.map +1 -1
- package/dist/components/tabs/tab-items/RuiTabItems.js.map +1 -1
- package/dist/components/tabs/tab-items/RuiTabItems.vue_vue_type_script_setup_true_lang.js +9 -2
- package/dist/components/tabs/tab-items/RuiTabItems.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composables/clip-while-resizing.d.ts +15 -0
- package/dist/composables/clip-while-resizing.js +46 -0
- package/dist/composables/clip-while-resizing.js.map +1 -0
- package/dist/composables/defaults/field.d.ts +19 -3
- package/dist/composables/defaults/field.js +32 -6
- package/dist/composables/defaults/field.js.map +1 -1
- package/dist/composables/sticky-blocker.d.ts +20 -0
- package/dist/composables/sticky-blocker.js +62 -0
- package/dist/composables/sticky-blocker.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js.map +1 -1
- package/dist/style.css +275 -0
- package/dist/utils/development.d.ts +6 -0
- package/dist/utils/development.js +17 -0
- package/dist/utils/development.js.map +1 -0
- package/dist/utils/form-text-detail.d.ts +15 -0
- package/dist/utils/form-text-detail.js +11 -1
- package/dist/utils/form-text-detail.js.map +1 -1
- package/dist/web-types.json +232 -3
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { get, useTimeoutFn } from "../vendor/@vueuse/shared/dist/index.js";
|
|
2
|
+
import { isDevelopment } from "../utils/development.js";
|
|
3
|
+
import { toValue, watch } from "vue";
|
|
4
|
+
//#region src/composables/sticky-blocker.ts
|
|
5
|
+
/** Long enough for an opening accordion or tab panel to settle before the check reads its overflow. */
|
|
6
|
+
var CHECK_DELAY_MS = 1e3;
|
|
7
|
+
/**
|
|
8
|
+
* The nearest ancestor with `overflow: hidden` on either axis, which a `position: sticky` element
|
|
9
|
+
* sticks to instead of the page. `hidden` never scrolls, so the element can never stick. `auto` and
|
|
10
|
+
* `scroll` are left out: those can be real scrolling areas, like a dialog body. `clip` makes no
|
|
11
|
+
* scroll container, so it never blocks. A box marked `data-clipped` clips only while it animates.
|
|
12
|
+
*
|
|
13
|
+
* @param element - where the walk up the tree starts; its own overflow does not count
|
|
14
|
+
* @returns the blocking ancestor, or undefined when nothing blocks the element
|
|
15
|
+
*/
|
|
16
|
+
function findStickyBlocker(element) {
|
|
17
|
+
let parent = element.parentElement;
|
|
18
|
+
while (parent && parent !== document.body && parent !== document.documentElement) {
|
|
19
|
+
const { overflowX, overflowY } = getComputedStyle(parent);
|
|
20
|
+
if ((overflowX === "hidden" || overflowY === "hidden") && !parent.hasAttribute("data-clipped")) return parent;
|
|
21
|
+
parent = parent.parentElement;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A short, recognizable name for an element in a console message.
|
|
26
|
+
*
|
|
27
|
+
* @param element - the element to name
|
|
28
|
+
* @returns its tag, `data-id` and first classes
|
|
29
|
+
*/
|
|
30
|
+
function describe(element) {
|
|
31
|
+
const id = element.dataset.id ? `[data-id="${element.dataset.id}"]` : "";
|
|
32
|
+
const classes = [...element.classList].slice(0, 3).map((name) => `.${name}`).join("");
|
|
33
|
+
return `<${element.tagName.toLowerCase()}${id}${classes}>`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* In a development build, warns once when an ancestor keeps a sticky element from sticking to the
|
|
37
|
+
* page. Silent in production, where the check does not run.
|
|
38
|
+
*
|
|
39
|
+
* @param element - the `position: sticky` box, checked once it is mounted
|
|
40
|
+
* @param enabled - whether the element is meant to stick
|
|
41
|
+
* @param name - what the element is, for the message
|
|
42
|
+
*/
|
|
43
|
+
function useStickyBlockerWarning(element, enabled, name) {
|
|
44
|
+
if (!isDevelopment()) return;
|
|
45
|
+
let warned = false;
|
|
46
|
+
function check() {
|
|
47
|
+
const target = get(element);
|
|
48
|
+
if (warned || !toValue(enabled) || !target) return;
|
|
49
|
+
const blocker = findStickyBlocker(target);
|
|
50
|
+
if (!blocker) return;
|
|
51
|
+
warned = true;
|
|
52
|
+
console.warn(`[@rotki/ui-library] ${name} cannot stick to the page: the ancestor ${describe(blocker)} has overflow: hidden, so the bar sticks to it instead. Use overflow: clip there (it clips the same without creating a scroll container), or move the element out of it.`, blocker);
|
|
53
|
+
}
|
|
54
|
+
const { start } = useTimeoutFn(check, CHECK_DELAY_MS, { immediate: false });
|
|
55
|
+
watch([element, () => toValue(enabled)], ([target, on]) => {
|
|
56
|
+
if (target && on) start();
|
|
57
|
+
}, { immediate: true });
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { findStickyBlocker, useStickyBlockerWarning };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=sticky-blocker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticky-blocker.js","names":[],"sources":["../../src/composables/sticky-blocker.ts"],"sourcesContent":["import type { MaybeRefOrGetter, Ref } from 'vue';\nimport { useTimeoutFn } from '@vueuse/core';\nimport { isDevelopment } from '@/utils/development';\n\n/** Long enough for an opening accordion or tab panel to settle before the check reads its overflow. */\nconst CHECK_DELAY_MS = 1000;\n\n/**\n * The nearest ancestor with `overflow: hidden` on either axis, which a `position: sticky` element\n * sticks to instead of the page. `hidden` never scrolls, so the element can never stick. `auto` and\n * `scroll` are left out: those can be real scrolling areas, like a dialog body. `clip` makes no\n * scroll container, so it never blocks. A box marked `data-clipped` clips only while it animates.\n *\n * @param element - where the walk up the tree starts; its own overflow does not count\n * @returns the blocking ancestor, or undefined when nothing blocks the element\n */\nexport function findStickyBlocker(element: HTMLElement): HTMLElement | undefined {\n let parent = element.parentElement;\n while (parent && parent !== document.body && parent !== document.documentElement) {\n const { overflowX, overflowY } = getComputedStyle(parent);\n if ((overflowX === 'hidden' || overflowY === 'hidden') && !parent.hasAttribute('data-clipped'))\n return parent;\n parent = parent.parentElement;\n }\n return undefined;\n}\n\n/**\n * A short, recognizable name for an element in a console message.\n *\n * @param element - the element to name\n * @returns its tag, `data-id` and first classes\n */\nfunction describe(element: HTMLElement): string {\n const id = element.dataset.id ? `[data-id=\"${element.dataset.id}\"]` : '';\n const classes = [...element.classList].slice(0, 3).map(name => `.${name}`).join('');\n return `<${element.tagName.toLowerCase()}${id}${classes}>`;\n}\n\n/**\n * In a development build, warns once when an ancestor keeps a sticky element from sticking to the\n * page. Silent in production, where the check does not run.\n *\n * @param element - the `position: sticky` box, checked once it is mounted\n * @param enabled - whether the element is meant to stick\n * @param name - what the element is, for the message\n */\nexport function useStickyBlockerWarning(\n element: Readonly<Ref<HTMLElement | null | undefined>>,\n enabled: MaybeRefOrGetter<boolean>,\n name: string,\n): void {\n if (!isDevelopment())\n return;\n\n let warned = false;\n\n function check(): void {\n const target = get(element);\n if (warned || !toValue(enabled) || !target)\n return;\n const blocker = findStickyBlocker(target);\n if (!blocker)\n return;\n warned = true;\n console.warn(\n `[@rotki/ui-library] ${name} cannot stick to the page: the ancestor ${describe(blocker)} has overflow: hidden, `\n + 'so the bar sticks to it instead. Use overflow: clip there (it clips the same without creating a scroll container), '\n + 'or move the element out of it.',\n blocker,\n );\n }\n\n const { start } = useTimeoutFn(check, CHECK_DELAY_MS, { immediate: false });\n\n watch([element, () => toValue(enabled)], ([target, on]) => {\n if (target && on)\n start();\n }, { immediate: true });\n}\n"],"mappings":";;;;;AAKA,IAAM,iBAAiB;;;;;;;;;;AAWvB,SAAgB,kBAAkB,SAA+C;CAC/E,IAAI,SAAS,QAAQ;CACrB,OAAO,UAAU,WAAW,SAAS,QAAQ,WAAW,SAAS,iBAAiB;EAChF,MAAM,EAAE,WAAW,cAAc,iBAAiB,MAAM;EACxD,KAAK,cAAc,YAAY,cAAc,aAAa,CAAC,OAAO,aAAa,cAAc,GAC3F,OAAO;EACT,SAAS,OAAO;CAClB;AAEF;;;;;;;AAQA,SAAS,SAAS,SAA8B;CAC9C,MAAM,KAAK,QAAQ,QAAQ,KAAK,aAAa,QAAQ,QAAQ,GAAG,MAAM;CACtE,MAAM,UAAU,CAAC,GAAG,QAAQ,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAI,SAAQ,IAAI,MAAM,CAAC,CAAC,KAAK,EAAE;CAClF,OAAO,IAAI,QAAQ,QAAQ,YAAY,IAAI,KAAK,QAAQ;AAC1D;;;;;;;;;AAUA,SAAgB,wBACd,SACA,SACA,MACM;CACN,IAAI,CAAC,cAAc,GACjB;CAEF,IAAI,SAAS;CAEb,SAAS,QAAc;EACrB,MAAM,SAAS,IAAI,OAAO;EAC1B,IAAI,UAAU,CAAC,QAAQ,OAAO,KAAK,CAAC,QAClC;EACF,MAAM,UAAU,kBAAkB,MAAM;EACxC,IAAI,CAAC,SACH;EACF,SAAS;EACT,QAAQ,KACN,uBAAuB,KAAK,0CAA0C,SAAS,OAAO,EAAE,2KAGxF,OACF;CACF;CAEA,MAAM,EAAE,UAAU,aAAa,OAAO,gBAAgB,EAAE,WAAW,MAAM,CAAC;CAE1E,MAAM,CAAC,eAAe,QAAQ,OAAO,CAAC,IAAI,CAAC,QAAQ,QAAQ;EACzD,IAAI,UAAU,IACZ,MAAM;CACV,GAAG,EAAE,WAAW,KAAK,CAAC;AACxB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import './style.css';
|
|
|
8
8
|
export * from './components/index.js';
|
|
9
9
|
export { activatorHandlers, type ActivatorHandlers } from './components/overlays/menu/activator-handlers.js';
|
|
10
10
|
export * from './composables/index.js';
|
|
11
|
-
export { type FieldOptions, type LabelPlacement, provideFieldDefaults } from './composables/defaults/field.js';
|
|
11
|
+
export { type FieldOptions, type FieldScopeOptions, type LabelPlacement, provideFieldDefaults } from './composables/defaults/field.js';
|
|
12
12
|
export type { LogoOptions, LogoResolver } from './composables/defaults/logo.js';
|
|
13
13
|
export { contextColors, type ContextColorsType } from './consts/colors.js';
|
|
14
14
|
export { translationKeys } from './i18n/keys.js';
|
|
@@ -17,13 +17,17 @@ export { StepperOrientation, StepperState, type StepperStep };
|
|
|
17
17
|
export type { VueClassValue } from './types/class-value.js';
|
|
18
18
|
export { type InitThemeOptions, type ThemeConfig, type ThemeContent, type ThemeData, ThemeMode, } from './types/theme.js';
|
|
19
19
|
export { createBlockie } from './utils/blockie.js';
|
|
20
|
+
export type { FormDetails } from './utils/form-text-detail.js';
|
|
20
21
|
export { cn, tv } from './utils/tv.js';
|
|
21
22
|
export type { VariantProps } from 'tailwind-variants';
|
|
22
23
|
export interface RuiOptions {
|
|
23
24
|
theme?: InitThemeOptions;
|
|
24
25
|
defaults?: {
|
|
25
26
|
table?: Partial<TableOptions>;
|
|
26
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* `labelPlacement` for every text field, text area, select and picker (`top` when unset),
|
|
29
|
+
* and `details` for every form control (`reserve` when unset).
|
|
30
|
+
*/
|
|
27
31
|
field?: Partial<FieldOptions>;
|
|
28
32
|
};
|
|
29
33
|
/**
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { App } from 'vue';\nimport type { InitThemeOptions } from '@/types/theme';\nimport { createFieldDefaults, type FieldOptions, FieldSymbol } from '@/composables/defaults/field';\nimport { type LogoOptions, LogoSymbol } from '@/composables/defaults/logo';\nimport {\n createTableDefaults,\n type TableOptions,\n TableSymbol,\n} from '@/composables/defaults/table';\nimport { createIconDefaults, IconsSymbol } from '@/composables/icons';\nimport { useRotkiTheme } from '@/composables/theme';\nimport { RUI_I18N_INJECTION_KEY } from '@/composables/use-rui-i18n';\nimport { StepperOrientation, StepperState, type StepperStep } from '@/types/stepper';\nimport '@/style.css';\n\nexport * from '@/components';\n\nexport { activatorHandlers, type ActivatorHandlers } from '@/components/overlays/menu/activator-handlers';\n\nexport * from '@/composables';\n\nexport { type FieldOptions, type LabelPlacement, provideFieldDefaults } from '@/composables/defaults/field';\n\nexport type { LogoOptions, LogoResolver } from '@/composables/defaults/logo';\n\nexport { contextColors, type ContextColorsType } from '@/consts/colors';\n\nexport { translationKeys } from '@/i18n/keys';\n\nexport * from '@/icons';\n\nexport { StepperOrientation, StepperState, type StepperStep };\n\nexport type { VueClassValue } from '@/types/class-value';\n\nexport {\n type InitThemeOptions,\n type ThemeConfig,\n type ThemeContent,\n type ThemeData,\n ThemeMode,\n} from '@/types/theme';\n\nexport { createBlockie } from '@/utils/blockie';\n\nexport { cn, tv } from '@/utils/tv';\n\nexport type { VariantProps } from 'tailwind-variants';\n\nexport interface RuiOptions {\n theme?: InitThemeOptions;\n defaults?: {\n table?: Partial<TableOptions>;\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { App } from 'vue';\nimport type { InitThemeOptions } from '@/types/theme';\nimport { createFieldDefaults, type FieldOptions, FieldSymbol } from '@/composables/defaults/field';\nimport { type LogoOptions, LogoSymbol } from '@/composables/defaults/logo';\nimport {\n createTableDefaults,\n type TableOptions,\n TableSymbol,\n} from '@/composables/defaults/table';\nimport { createIconDefaults, IconsSymbol } from '@/composables/icons';\nimport { useRotkiTheme } from '@/composables/theme';\nimport { RUI_I18N_INJECTION_KEY } from '@/composables/use-rui-i18n';\nimport { StepperOrientation, StepperState, type StepperStep } from '@/types/stepper';\nimport '@/style.css';\n\nexport * from '@/components';\n\nexport { activatorHandlers, type ActivatorHandlers } from '@/components/overlays/menu/activator-handlers';\n\nexport * from '@/composables';\n\nexport { type FieldOptions, type FieldScopeOptions, type LabelPlacement, provideFieldDefaults } from '@/composables/defaults/field';\n\nexport type { LogoOptions, LogoResolver } from '@/composables/defaults/logo';\n\nexport { contextColors, type ContextColorsType } from '@/consts/colors';\n\nexport { translationKeys } from '@/i18n/keys';\n\nexport * from '@/icons';\n\nexport { StepperOrientation, StepperState, type StepperStep };\n\nexport type { VueClassValue } from '@/types/class-value';\n\nexport {\n type InitThemeOptions,\n type ThemeConfig,\n type ThemeContent,\n type ThemeData,\n ThemeMode,\n} from '@/types/theme';\n\nexport { createBlockie } from '@/utils/blockie';\n\nexport type { FormDetails } from '@/utils/form-text-detail';\n\nexport { cn, tv } from '@/utils/tv';\n\nexport type { VariantProps } from 'tailwind-variants';\n\nexport interface RuiOptions {\n theme?: InitThemeOptions;\n defaults?: {\n table?: Partial<TableOptions>;\n /**\n * `labelPlacement` for every text field, text area, select and picker (`top` when unset),\n * and `details` for every form control (`reserve` when unset).\n */\n field?: Partial<FieldOptions>;\n };\n /**\n * Where `RuiLogo` gets the image for its `logo` prop. Without it every\n * `RuiLogo` shows the bundled logo, and the library makes no network request.\n */\n logo?: LogoOptions;\n}\n\nexport function createRui(options: RuiOptions = {}) {\n const { theme, defaults: defaultOptions, logo } = options;\n\n const defaults = Object.freeze({\n icons: createIconDefaults({\n registeredIcons: theme?.icons,\n }),\n table: createTableDefaults(defaultOptions?.table),\n field: createFieldDefaults(defaultOptions?.field),\n });\n\n const install = (app: App) => {\n useRotkiTheme().init({ ...theme });\n\n app.provide(TableSymbol, defaults.table);\n app.provide(IconsSymbol, defaults.icons);\n app.provide(FieldSymbol, defaults.field);\n\n if (logo)\n app.provide(LogoSymbol, logo);\n };\n\n return {\n defaults,\n install,\n };\n}\n\nexport function createRuiI8nPlugin(i18nInstance: any) {\n if (!i18nInstance || typeof i18nInstance !== 'object') {\n throw new Error('i18nInstance must be an object');\n }\n\n if (!i18nInstance.global || typeof i18nInstance.global !== 'object') {\n throw new Error('i18nInstance must have a global property');\n }\n\n if (!i18nInstance.global.t || typeof i18nInstance.global.t !== 'function') {\n throw new Error('i18nInstance.global.t must be a function');\n }\n\n if (!i18nInstance.global.te || typeof i18nInstance.global.te !== 'function') {\n throw new Error('i18nInstance.global.te must be a function');\n }\n\n return {\n install: (app: App) => {\n app.provide(RUI_I18N_INJECTION_KEY, {\n t: i18nInstance.global.t.bind(i18nInstance.global),\n te: i18nInstance.global.te.bind(i18nInstance.global),\n });\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,SAAgB,UAAU,UAAsB,CAAC,GAAG;CAClD,MAAM,EAAE,OAAO,UAAU,gBAAgB,SAAS;CAElD,MAAM,WAAW,OAAO,OAAO;EAC7B,OAAO,mBAAmB,EACxB,iBAAiB,OAAO,MAC1B,CAAC;EACD,OAAO,oBAAoB,gBAAgB,KAAK;EAChD,OAAO,oBAAoB,gBAAgB,KAAK;CAClD,CAAC;CAED,MAAM,WAAW,QAAa;EAC5B,cAAc,CAAC,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC;EAEjC,IAAI,QAAQ,aAAa,SAAS,KAAK;EACvC,IAAI,QAAQ,aAAa,SAAS,KAAK;EACvC,IAAI,QAAQ,aAAa,SAAS,KAAK;EAEvC,IAAI,MACF,IAAI,QAAQ,YAAY,IAAI;CAChC;CAEA,OAAO;EACL;EACA;CACF;AACF;AAEA,SAAgB,mBAAmB,cAAmB;CACpD,IAAI,CAAC,gBAAgB,OAAO,iBAAiB,UAC3C,MAAM,IAAI,MAAM,gCAAgC;CAGlD,IAAI,CAAC,aAAa,UAAU,OAAO,aAAa,WAAW,UACzD,MAAM,IAAI,MAAM,0CAA0C;CAG5D,IAAI,CAAC,aAAa,OAAO,KAAK,OAAO,aAAa,OAAO,MAAM,YAC7D,MAAM,IAAI,MAAM,0CAA0C;CAG5D,IAAI,CAAC,aAAa,OAAO,MAAM,OAAO,aAAa,OAAO,OAAO,YAC/D,MAAM,IAAI,MAAM,2CAA2C;CAG7D,OAAO,EACL,UAAU,QAAa;EACrB,IAAI,QAAQ,wBAAwB;GAClC,GAAG,aAAa,OAAO,EAAE,KAAK,aAAa,MAAM;GACjD,IAAI,aAAa,OAAO,GAAG,KAAK,aAAa,MAAM;EACrD,CAAC;CACH,EACF;AACF"}
|
package/dist/style.css
CHANGED
|
@@ -1088,6 +1088,18 @@
|
|
|
1088
1088
|
margin-bottom: calc(var(--spacing) * -2);
|
|
1089
1089
|
}
|
|
1090
1090
|
|
|
1091
|
+
.-mb-\[0\.4375rem\] {
|
|
1092
|
+
margin-bottom: -.4375rem;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
.-mb-\[0\.5625rem\] {
|
|
1096
|
+
margin-bottom: -.5625rem;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
.-mb-\[0\.6875rem\] {
|
|
1100
|
+
margin-bottom: -.6875rem;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1091
1103
|
.mb-0 {
|
|
1092
1104
|
margin-bottom: 0;
|
|
1093
1105
|
}
|
|
@@ -1153,6 +1165,13 @@
|
|
|
1153
1165
|
scrollbar-width: none;
|
|
1154
1166
|
}
|
|
1155
1167
|
|
|
1168
|
+
.line-clamp-2 {
|
|
1169
|
+
-webkit-line-clamp: 2;
|
|
1170
|
+
-webkit-box-orient: vertical;
|
|
1171
|
+
display: -webkit-box;
|
|
1172
|
+
overflow: hidden;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1156
1175
|
.\!hidden {
|
|
1157
1176
|
display: none !important;
|
|
1158
1177
|
}
|
|
@@ -1957,6 +1976,10 @@
|
|
|
1957
1976
|
gap: calc(var(--spacing) * 6);
|
|
1958
1977
|
}
|
|
1959
1978
|
|
|
1979
|
+
.gap-x-1 {
|
|
1980
|
+
column-gap: var(--spacing);
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1960
1983
|
.gap-x-1\.5 {
|
|
1961
1984
|
column-gap: calc(var(--spacing) * 1.5);
|
|
1962
1985
|
}
|
|
@@ -3102,6 +3125,26 @@
|
|
|
3102
3125
|
padding-left: calc(var(--spacing) * 3) !important;
|
|
3103
3126
|
}
|
|
3104
3127
|
|
|
3128
|
+
.pl-7\.25 {
|
|
3129
|
+
padding-left: calc(var(--spacing) * 7.25);
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3132
|
+
.pl-8\.25 {
|
|
3133
|
+
padding-left: calc(var(--spacing) * 8.25);
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3136
|
+
.pl-9\.25 {
|
|
3137
|
+
padding-left: calc(var(--spacing) * 9.25);
|
|
3138
|
+
}
|
|
3139
|
+
|
|
3140
|
+
.pl-11\.75 {
|
|
3141
|
+
padding-left: calc(var(--spacing) * 11.75);
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
.pl-13\.25 {
|
|
3145
|
+
padding-left: calc(var(--spacing) * 13.25);
|
|
3146
|
+
}
|
|
3147
|
+
|
|
3105
3148
|
.text-center {
|
|
3106
3149
|
text-align: center;
|
|
3107
3150
|
}
|
|
@@ -3114,6 +3157,10 @@
|
|
|
3114
3157
|
text-align: right;
|
|
3115
3158
|
}
|
|
3116
3159
|
|
|
3160
|
+
.align-baseline {
|
|
3161
|
+
vertical-align: baseline;
|
|
3162
|
+
}
|
|
3163
|
+
|
|
3117
3164
|
.align-middle {
|
|
3118
3165
|
vertical-align: middle;
|
|
3119
3166
|
}
|
|
@@ -3249,6 +3296,11 @@
|
|
|
3249
3296
|
line-height: calc(var(--spacing) * 7);
|
|
3250
3297
|
}
|
|
3251
3298
|
|
|
3299
|
+
.text-\[0\.6875rem\]\/4 {
|
|
3300
|
+
font-size: .6875rem;
|
|
3301
|
+
line-height: calc(var(--spacing) * 4);
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3252
3304
|
.text-\[0\.8125rem\]\/5 {
|
|
3253
3305
|
font-size: .8125rem;
|
|
3254
3306
|
line-height: calc(var(--spacing) * 5);
|
|
@@ -3320,6 +3372,10 @@
|
|
|
3320
3372
|
font-size: 1rem;
|
|
3321
3373
|
}
|
|
3322
3374
|
|
|
3375
|
+
.text-\[length\:inherit\] {
|
|
3376
|
+
font-size: inherit;
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3323
3379
|
.leading-3 {
|
|
3324
3380
|
--tw-leading: calc(var(--spacing) * 3);
|
|
3325
3381
|
line-height: calc(var(--spacing) * 3);
|
|
@@ -3340,6 +3396,11 @@
|
|
|
3340
3396
|
line-height: calc(var(--spacing) * 6);
|
|
3341
3397
|
}
|
|
3342
3398
|
|
|
3399
|
+
.leading-\[inherit\] {
|
|
3400
|
+
--tw-leading: inherit;
|
|
3401
|
+
line-height: inherit;
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3343
3404
|
.leading-none {
|
|
3344
3405
|
--tw-leading: 1;
|
|
3345
3406
|
line-height: 1;
|
|
@@ -3548,6 +3609,10 @@
|
|
|
3548
3609
|
text-decoration-line: underline;
|
|
3549
3610
|
}
|
|
3550
3611
|
|
|
3612
|
+
.underline-offset-2 {
|
|
3613
|
+
text-underline-offset: 2px;
|
|
3614
|
+
}
|
|
3615
|
+
|
|
3551
3616
|
.opacity-0 {
|
|
3552
3617
|
opacity: 0;
|
|
3553
3618
|
}
|
|
@@ -4091,6 +4156,10 @@
|
|
|
4091
4156
|
--rui-icon-size: 1.375rem !important;
|
|
4092
4157
|
}
|
|
4093
4158
|
|
|
4159
|
+
.\!\[--rui-icon-size\:1em\] {
|
|
4160
|
+
--rui-icon-size: 1em !important;
|
|
4161
|
+
}
|
|
4162
|
+
|
|
4094
4163
|
.\!\[--rui-icon-size\:100\%\] {
|
|
4095
4164
|
--rui-icon-size: 100% !important;
|
|
4096
4165
|
}
|
|
@@ -4135,6 +4204,38 @@
|
|
|
4135
4204
|
--rui-alert: var(--rui-warning-main);
|
|
4136
4205
|
}
|
|
4137
4206
|
|
|
4207
|
+
.\[--rui-btn-collapsed-icon\:0\.875rem\] {
|
|
4208
|
+
--rui-btn-collapsed-icon: .875rem;
|
|
4209
|
+
}
|
|
4210
|
+
|
|
4211
|
+
.\[--rui-btn-collapsed-icon\:1\.5rem\] {
|
|
4212
|
+
--rui-btn-collapsed-icon: 1.5rem;
|
|
4213
|
+
}
|
|
4214
|
+
|
|
4215
|
+
.\[--rui-btn-collapsed-icon\:1\.25rem\] {
|
|
4216
|
+
--rui-btn-collapsed-icon: 1.25rem;
|
|
4217
|
+
}
|
|
4218
|
+
|
|
4219
|
+
.\[--rui-btn-collapsed-icon\:1\.75rem\] {
|
|
4220
|
+
--rui-btn-collapsed-icon: 1.75rem;
|
|
4221
|
+
}
|
|
4222
|
+
|
|
4223
|
+
.\[--rui-btn-collapsed-p\:0\.5rem\] {
|
|
4224
|
+
--rui-btn-collapsed-p: .5rem;
|
|
4225
|
+
}
|
|
4226
|
+
|
|
4227
|
+
.\[--rui-btn-collapsed-p\:0\.25rem\] {
|
|
4228
|
+
--rui-btn-collapsed-p: .25rem;
|
|
4229
|
+
}
|
|
4230
|
+
|
|
4231
|
+
.\[--rui-btn-collapsed-p\:0\.375rem\] {
|
|
4232
|
+
--rui-btn-collapsed-p: .375rem;
|
|
4233
|
+
}
|
|
4234
|
+
|
|
4235
|
+
.\[--rui-btn-collapsed-p\:0\.1875rem\] {
|
|
4236
|
+
--rui-btn-collapsed-p: .1875rem;
|
|
4237
|
+
}
|
|
4238
|
+
|
|
4138
4239
|
.\[--rui-icon-size\:0\.75rem\] {
|
|
4139
4240
|
--rui-icon-size: .75rem;
|
|
4140
4241
|
}
|
|
@@ -4498,6 +4599,10 @@
|
|
|
4498
4599
|
.not-disabled\:hover\:state-layer-pressed:not(:disabled):hover {
|
|
4499
4600
|
background-image: linear-gradient(var(--rui-pressed), var(--rui-pressed));
|
|
4500
4601
|
}
|
|
4602
|
+
|
|
4603
|
+
.not-disabled\:hover\:underline:not(:disabled):hover {
|
|
4604
|
+
text-decoration-line: underline;
|
|
4605
|
+
}
|
|
4501
4606
|
}
|
|
4502
4607
|
|
|
4503
4608
|
.focus\:z-1:focus {
|
|
@@ -4661,6 +4766,10 @@
|
|
|
4661
4766
|
}
|
|
4662
4767
|
}
|
|
4663
4768
|
|
|
4769
|
+
.active\:bg-transparent:active {
|
|
4770
|
+
background-color: #0000;
|
|
4771
|
+
}
|
|
4772
|
+
|
|
4664
4773
|
.active\:state-layer-pressed:active {
|
|
4665
4774
|
background-image: linear-gradient(var(--rui-pressed), var(--rui-pressed));
|
|
4666
4775
|
}
|
|
@@ -4758,6 +4867,136 @@
|
|
|
4758
4867
|
}
|
|
4759
4868
|
}
|
|
4760
4869
|
|
|
4870
|
+
@media not all and (min-width: 96rem) {
|
|
4871
|
+
.max-2xl\:sr-only {
|
|
4872
|
+
clip-path: inset(50%);
|
|
4873
|
+
white-space: nowrap;
|
|
4874
|
+
border-width: 0;
|
|
4875
|
+
width: 1px;
|
|
4876
|
+
height: 1px;
|
|
4877
|
+
margin: -1px;
|
|
4878
|
+
padding: 0;
|
|
4879
|
+
position: absolute;
|
|
4880
|
+
overflow: hidden;
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4883
|
+
.max-2xl\:gap-x-0 {
|
|
4884
|
+
column-gap: 0;
|
|
4885
|
+
}
|
|
4886
|
+
|
|
4887
|
+
.max-2xl\:p-\(--rui-btn-collapsed-p\) {
|
|
4888
|
+
padding: var(--rui-btn-collapsed-p);
|
|
4889
|
+
}
|
|
4890
|
+
|
|
4891
|
+
.max-2xl\:\!\[--rui-icon-size\:var\(--rui-btn-collapsed-icon\)\] {
|
|
4892
|
+
--rui-icon-size: var(--rui-btn-collapsed-icon) !important;
|
|
4893
|
+
}
|
|
4894
|
+
}
|
|
4895
|
+
|
|
4896
|
+
@media not all and (min-width: 80rem) {
|
|
4897
|
+
.max-xl\:sr-only {
|
|
4898
|
+
clip-path: inset(50%);
|
|
4899
|
+
white-space: nowrap;
|
|
4900
|
+
border-width: 0;
|
|
4901
|
+
width: 1px;
|
|
4902
|
+
height: 1px;
|
|
4903
|
+
margin: -1px;
|
|
4904
|
+
padding: 0;
|
|
4905
|
+
position: absolute;
|
|
4906
|
+
overflow: hidden;
|
|
4907
|
+
}
|
|
4908
|
+
|
|
4909
|
+
.max-xl\:gap-x-0 {
|
|
4910
|
+
column-gap: 0;
|
|
4911
|
+
}
|
|
4912
|
+
|
|
4913
|
+
.max-xl\:p-\(--rui-btn-collapsed-p\) {
|
|
4914
|
+
padding: var(--rui-btn-collapsed-p);
|
|
4915
|
+
}
|
|
4916
|
+
|
|
4917
|
+
.max-xl\:\!\[--rui-icon-size\:var\(--rui-btn-collapsed-icon\)\] {
|
|
4918
|
+
--rui-icon-size: var(--rui-btn-collapsed-icon) !important;
|
|
4919
|
+
}
|
|
4920
|
+
}
|
|
4921
|
+
|
|
4922
|
+
@media not all and (min-width: 64rem) {
|
|
4923
|
+
.max-lg\:sr-only {
|
|
4924
|
+
clip-path: inset(50%);
|
|
4925
|
+
white-space: nowrap;
|
|
4926
|
+
border-width: 0;
|
|
4927
|
+
width: 1px;
|
|
4928
|
+
height: 1px;
|
|
4929
|
+
margin: -1px;
|
|
4930
|
+
padding: 0;
|
|
4931
|
+
position: absolute;
|
|
4932
|
+
overflow: hidden;
|
|
4933
|
+
}
|
|
4934
|
+
|
|
4935
|
+
.max-lg\:gap-x-0 {
|
|
4936
|
+
column-gap: 0;
|
|
4937
|
+
}
|
|
4938
|
+
|
|
4939
|
+
.max-lg\:p-\(--rui-btn-collapsed-p\) {
|
|
4940
|
+
padding: var(--rui-btn-collapsed-p);
|
|
4941
|
+
}
|
|
4942
|
+
|
|
4943
|
+
.max-lg\:\!\[--rui-icon-size\:var\(--rui-btn-collapsed-icon\)\] {
|
|
4944
|
+
--rui-icon-size: var(--rui-btn-collapsed-icon) !important;
|
|
4945
|
+
}
|
|
4946
|
+
}
|
|
4947
|
+
|
|
4948
|
+
@media not all and (min-width: 48rem) {
|
|
4949
|
+
.max-md\:sr-only {
|
|
4950
|
+
clip-path: inset(50%);
|
|
4951
|
+
white-space: nowrap;
|
|
4952
|
+
border-width: 0;
|
|
4953
|
+
width: 1px;
|
|
4954
|
+
height: 1px;
|
|
4955
|
+
margin: -1px;
|
|
4956
|
+
padding: 0;
|
|
4957
|
+
position: absolute;
|
|
4958
|
+
overflow: hidden;
|
|
4959
|
+
}
|
|
4960
|
+
|
|
4961
|
+
.max-md\:gap-x-0 {
|
|
4962
|
+
column-gap: 0;
|
|
4963
|
+
}
|
|
4964
|
+
|
|
4965
|
+
.max-md\:p-\(--rui-btn-collapsed-p\) {
|
|
4966
|
+
padding: var(--rui-btn-collapsed-p);
|
|
4967
|
+
}
|
|
4968
|
+
|
|
4969
|
+
.max-md\:\!\[--rui-icon-size\:var\(--rui-btn-collapsed-icon\)\] {
|
|
4970
|
+
--rui-icon-size: var(--rui-btn-collapsed-icon) !important;
|
|
4971
|
+
}
|
|
4972
|
+
}
|
|
4973
|
+
|
|
4974
|
+
@media not all and (min-width: 40rem) {
|
|
4975
|
+
.max-sm\:sr-only {
|
|
4976
|
+
clip-path: inset(50%);
|
|
4977
|
+
white-space: nowrap;
|
|
4978
|
+
border-width: 0;
|
|
4979
|
+
width: 1px;
|
|
4980
|
+
height: 1px;
|
|
4981
|
+
margin: -1px;
|
|
4982
|
+
padding: 0;
|
|
4983
|
+
position: absolute;
|
|
4984
|
+
overflow: hidden;
|
|
4985
|
+
}
|
|
4986
|
+
|
|
4987
|
+
.max-sm\:gap-x-0 {
|
|
4988
|
+
column-gap: 0;
|
|
4989
|
+
}
|
|
4990
|
+
|
|
4991
|
+
.max-sm\:p-\(--rui-btn-collapsed-p\) {
|
|
4992
|
+
padding: var(--rui-btn-collapsed-p);
|
|
4993
|
+
}
|
|
4994
|
+
|
|
4995
|
+
.max-sm\:\!\[--rui-icon-size\:var\(--rui-btn-collapsed-icon\)\] {
|
|
4996
|
+
--rui-icon-size: var(--rui-btn-collapsed-icon) !important;
|
|
4997
|
+
}
|
|
4998
|
+
}
|
|
4999
|
+
|
|
4761
5000
|
@media (min-width: 64rem) {
|
|
4762
5001
|
.lg\:whitespace-normal {
|
|
4763
5002
|
white-space: normal;
|
|
@@ -5162,6 +5401,10 @@
|
|
|
5162
5401
|
color: var(--rui-text-disabled);
|
|
5163
5402
|
}
|
|
5164
5403
|
|
|
5404
|
+
.dark\:text-rui-text-secondary:is(.dark *, [data-theme="dark"] *) {
|
|
5405
|
+
color: var(--rui-text-secondary);
|
|
5406
|
+
}
|
|
5407
|
+
|
|
5165
5408
|
.dark\:text-rui-warning:is(.dark *, [data-theme="dark"] *) {
|
|
5166
5409
|
color: rgb(var(--rui-warning-main));
|
|
5167
5410
|
}
|
|
@@ -5312,6 +5555,10 @@
|
|
|
5312
5555
|
}
|
|
5313
5556
|
}
|
|
5314
5557
|
|
|
5558
|
+
.dark\:active\:bg-transparent:is(.dark *, [data-theme="dark"] *):active {
|
|
5559
|
+
background-color: #0000;
|
|
5560
|
+
}
|
|
5561
|
+
|
|
5315
5562
|
.dark\:disabled\:\!bg-rui-neutral-800:is(.dark *, [data-theme="dark"] *):disabled {
|
|
5316
5563
|
background-color: rgb(var(--rui-neutral-800)) !important;
|
|
5317
5564
|
}
|
|
@@ -5600,6 +5847,10 @@
|
|
|
5600
5847
|
background-color: rgb(var(--rui-primary-main));
|
|
5601
5848
|
}
|
|
5602
5849
|
|
|
5850
|
+
.\[\&\>tr\]\:block > tr {
|
|
5851
|
+
display: block;
|
|
5852
|
+
}
|
|
5853
|
+
|
|
5603
5854
|
:where(.\[\:where\(\&\)\]\:h-8) {
|
|
5604
5855
|
height: calc(var(--spacing) * 8);
|
|
5605
5856
|
}
|
|
@@ -5715,6 +5966,30 @@
|
|
|
5715
5966
|
color: var(--rui-text-secondary);
|
|
5716
5967
|
}
|
|
5717
5968
|
|
|
5969
|
+
:where(.\[\:where\(\&\>tr\>\*\)\]\:block > tr > *) {
|
|
5970
|
+
display: block;
|
|
5971
|
+
}
|
|
5972
|
+
|
|
5973
|
+
:where(.\[\:where\(\&\>tr\>\*\)\]\:h-9 > tr > *) {
|
|
5974
|
+
height: calc(var(--spacing) * 9);
|
|
5975
|
+
}
|
|
5976
|
+
|
|
5977
|
+
:where(.\[\:where\(\&\>tr\>\*\)\]\:h-11 > tr > *) {
|
|
5978
|
+
height: calc(var(--spacing) * 11);
|
|
5979
|
+
}
|
|
5980
|
+
|
|
5981
|
+
:where(.\[\:where\(\&\>tr\>\*\)\]\:px-4 > tr > *) {
|
|
5982
|
+
padding-inline: calc(var(--spacing) * 4);
|
|
5983
|
+
}
|
|
5984
|
+
|
|
5985
|
+
:where(.\[\:where\(\&\>tr\>\*\)\]\:py-1 > tr > *) {
|
|
5986
|
+
padding-block: var(--spacing);
|
|
5987
|
+
}
|
|
5988
|
+
|
|
5989
|
+
:where(.\[\:where\(\&\>tr\>\*\)\]\:py-2 > tr > *) {
|
|
5990
|
+
padding-block: calc(var(--spacing) * 2);
|
|
5991
|
+
}
|
|
5992
|
+
|
|
5718
5993
|
:where(.\[\:where\(\&\>tr\[data-stripe\]\)\]\:bg-rui-neutral-950\/\[0\.015\] > tr[data-stripe]) {
|
|
5719
5994
|
background-color: rgb(var(--rui-neutral-950));
|
|
5720
5995
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/utils/development.ts
|
|
2
|
+
/**
|
|
3
|
+
* Whether the app runs a development build, for warnings a production build should not carry.
|
|
4
|
+
*
|
|
5
|
+
* @returns false in a production build, and where nothing replaced `process.env.NODE_ENV`
|
|
6
|
+
*/
|
|
7
|
+
function isDevelopment() {
|
|
8
|
+
try {
|
|
9
|
+
return process.env.NODE_ENV !== "production";
|
|
10
|
+
} catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { isDevelopment };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=development.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"development.js","names":[],"sources":["../../src/utils/development.ts"],"sourcesContent":["/**\n * The consumer's bundler replaces `process.env.NODE_ENV`; the library build leaves it in place on\n * purpose, since `import.meta.env.DEV` would be fixed to false when the library is built. Declared\n * here rather than globally, where it would clash with `@types/node` in the test build.\n */\ndeclare const process: { env: { NODE_ENV?: string } };\n\n/**\n * Whether the app runs a development build, for warnings a production build should not carry.\n *\n * @returns false in a production build, and where nothing replaced `process.env.NODE_ENV`\n */\nexport function isDevelopment(): boolean {\n try {\n return process.env.NODE_ENV !== 'production';\n }\n catch {\n return false;\n }\n}\n"],"mappings":";;;;;;AAYA,SAAgB,gBAAyB;CACvC,IAAI;EACF,OAAA,QAAA,IAAA,aAAgC;CAClC,QACM;EACJ,OAAO;CACT;AACF"}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import type { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
2
2
|
export type ValidationState = 'error' | 'success' | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* How a control handles the line under it for its hint, error or success message.
|
|
5
|
+
*
|
|
6
|
+
* - `reserve`: the line is always there, so a message never moves what is below (the default).
|
|
7
|
+
* - `auto`: no space while there is nothing to show; the line appears with a hint, error or
|
|
8
|
+
* success message and pushes what is below down.
|
|
9
|
+
* - `hidden`: no line and no message text. An error still marks the control invalid.
|
|
10
|
+
*/
|
|
11
|
+
export type FormDetails = 'reserve' | 'auto' | 'hidden';
|
|
12
|
+
/**
|
|
13
|
+
* The details mode a control uses: `hidden` while the deprecated `hideDetails` is set,
|
|
14
|
+
* otherwise its `details` prop, then the nearest `RuiFieldDefaults` scope, then the app
|
|
15
|
+
* default, then `reserve`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useFormDetails(details: MaybeRefOrGetter<FormDetails | undefined>, hideDetails: MaybeRefOrGetter<boolean>): ComputedRef<FormDetails>;
|
|
3
18
|
export interface FormTextDetailReturn {
|
|
4
19
|
formattedErrorMessages: ComputedRef<string[]>;
|
|
5
20
|
formattedSuccessMessages: ComputedRef<string[]>;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
import { useInheritedDetails } from "../composables/defaults/field.js";
|
|
1
2
|
import { get } from "../vendor/@vueuse/shared/dist/index.js";
|
|
2
3
|
import { computed, toValue } from "vue";
|
|
3
4
|
//#region src/utils/form-text-detail.ts
|
|
5
|
+
/**
|
|
6
|
+
* The details mode a control uses: `hidden` while the deprecated `hideDetails` is set,
|
|
7
|
+
* otherwise its `details` prop, then the nearest `RuiFieldDefaults` scope, then the app
|
|
8
|
+
* default, then `reserve`.
|
|
9
|
+
*/
|
|
10
|
+
function useFormDetails(details, hideDetails) {
|
|
11
|
+
const inherited = useInheritedDetails();
|
|
12
|
+
return computed(() => toValue(hideDetails) ? "hidden" : toValue(details) ?? inherited() ?? "reserve");
|
|
13
|
+
}
|
|
4
14
|
function useFormTextDetail(errorMessages, successMessages) {
|
|
5
15
|
const formattedErrorMessages = computed(() => {
|
|
6
16
|
let errorMessagesVal = toValue(errorMessages);
|
|
@@ -27,6 +37,6 @@ function useFormTextDetail(errorMessages, successMessages) {
|
|
|
27
37
|
};
|
|
28
38
|
}
|
|
29
39
|
//#endregion
|
|
30
|
-
export { useFormTextDetail };
|
|
40
|
+
export { useFormDetails, useFormTextDetail };
|
|
31
41
|
|
|
32
42
|
//# sourceMappingURL=form-text-detail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-text-detail.js","names":[],"sources":["../../src/utils/form-text-detail.ts"],"sourcesContent":["import type { ComputedRef, MaybeRefOrGetter } from 'vue';\n\nexport type ValidationState = 'error' | 'success' | undefined;\n\nexport interface FormTextDetailReturn {\n formattedErrorMessages: ComputedRef<string[]>;\n formattedSuccessMessages: ComputedRef<string[]>;\n hasError: ComputedRef<boolean>;\n hasMessages: ComputedRef<boolean>;\n hasSuccess: ComputedRef<boolean>;\n validation: ComputedRef<ValidationState>;\n}\n\nexport function useFormTextDetail(\n errorMessages: MaybeRefOrGetter<string | string[]>,\n successMessages: MaybeRefOrGetter<string | string[]>,\n): FormTextDetailReturn {\n const formattedErrorMessages = computed<string[]>(() => {\n let errorMessagesVal = toValue(errorMessages);\n if (typeof errorMessagesVal === 'string')\n errorMessagesVal = [errorMessagesVal];\n\n return errorMessagesVal.filter(item => !!item);\n });\n\n const formattedSuccessMessages = computed<string[]>(() => {\n let successMessagesVal = toValue(successMessages);\n if (typeof successMessagesVal === 'string')\n successMessagesVal = [successMessagesVal];\n\n return successMessagesVal.filter(item => !!item);\n });\n\n const hasError = computed<boolean>(() => get(formattedErrorMessages).length > 0);\n const hasSuccess = computed<boolean>(() => get(formattedSuccessMessages).length > 0);\n const hasMessages = computed<boolean>(() => get(hasError) || get(hasSuccess));\n\n const validation = computed<ValidationState>(() => {\n if (get(hasError))\n return 'error';\n if (get(hasSuccess))\n return 'success';\n return undefined;\n });\n\n return {\n formattedErrorMessages,\n formattedSuccessMessages,\n hasError,\n hasMessages,\n hasSuccess,\n validation,\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-text-detail.js","names":[],"sources":["../../src/utils/form-text-detail.ts"],"sourcesContent":["import type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport { useInheritedDetails } from '@/composables/defaults/field';\n\nexport type ValidationState = 'error' | 'success' | undefined;\n\n/**\n * How a control handles the line under it for its hint, error or success message.\n *\n * - `reserve`: the line is always there, so a message never moves what is below (the default).\n * - `auto`: no space while there is nothing to show; the line appears with a hint, error or\n * success message and pushes what is below down.\n * - `hidden`: no line and no message text. An error still marks the control invalid.\n */\nexport type FormDetails = 'reserve' | 'auto' | 'hidden';\n\n/**\n * The details mode a control uses: `hidden` while the deprecated `hideDetails` is set,\n * otherwise its `details` prop, then the nearest `RuiFieldDefaults` scope, then the app\n * default, then `reserve`.\n */\nexport function useFormDetails(\n details: MaybeRefOrGetter<FormDetails | undefined>,\n hideDetails: MaybeRefOrGetter<boolean>,\n): ComputedRef<FormDetails> {\n const inherited = useInheritedDetails();\n return computed<FormDetails>(() => (toValue(hideDetails) ? 'hidden' : toValue(details) ?? inherited() ?? 'reserve'));\n}\n\nexport interface FormTextDetailReturn {\n formattedErrorMessages: ComputedRef<string[]>;\n formattedSuccessMessages: ComputedRef<string[]>;\n hasError: ComputedRef<boolean>;\n hasMessages: ComputedRef<boolean>;\n hasSuccess: ComputedRef<boolean>;\n validation: ComputedRef<ValidationState>;\n}\n\nexport function useFormTextDetail(\n errorMessages: MaybeRefOrGetter<string | string[]>,\n successMessages: MaybeRefOrGetter<string | string[]>,\n): FormTextDetailReturn {\n const formattedErrorMessages = computed<string[]>(() => {\n let errorMessagesVal = toValue(errorMessages);\n if (typeof errorMessagesVal === 'string')\n errorMessagesVal = [errorMessagesVal];\n\n return errorMessagesVal.filter(item => !!item);\n });\n\n const formattedSuccessMessages = computed<string[]>(() => {\n let successMessagesVal = toValue(successMessages);\n if (typeof successMessagesVal === 'string')\n successMessagesVal = [successMessagesVal];\n\n return successMessagesVal.filter(item => !!item);\n });\n\n const hasError = computed<boolean>(() => get(formattedErrorMessages).length > 0);\n const hasSuccess = computed<boolean>(() => get(formattedSuccessMessages).length > 0);\n const hasMessages = computed<boolean>(() => get(hasError) || get(hasSuccess));\n\n const validation = computed<ValidationState>(() => {\n if (get(hasError))\n return 'error';\n if (get(hasSuccess))\n return 'success';\n return undefined;\n });\n\n return {\n formattedErrorMessages,\n formattedSuccessMessages,\n hasError,\n hasMessages,\n hasSuccess,\n validation,\n };\n}\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,eACd,SACA,aAC0B;CAC1B,MAAM,YAAY,oBAAoB;CACtC,OAAO,eAA6B,QAAQ,WAAW,IAAI,WAAW,QAAQ,OAAO,KAAK,UAAU,KAAK,SAAU;AACrH;AAWA,SAAgB,kBACd,eACA,iBACsB;CACtB,MAAM,yBAAyB,eAAyB;EACtD,IAAI,mBAAmB,QAAQ,aAAa;EAC5C,IAAI,OAAO,qBAAqB,UAC9B,mBAAmB,CAAC,gBAAgB;EAEtC,OAAO,iBAAiB,QAAO,SAAQ,CAAC,CAAC,IAAI;CAC/C,CAAC;CAED,MAAM,2BAA2B,eAAyB;EACxD,IAAI,qBAAqB,QAAQ,eAAe;EAChD,IAAI,OAAO,uBAAuB,UAChC,qBAAqB,CAAC,kBAAkB;EAE1C,OAAO,mBAAmB,QAAO,SAAQ,CAAC,CAAC,IAAI;CACjD,CAAC;CAED,MAAM,WAAW,eAAwB,IAAI,sBAAsB,CAAC,CAAC,SAAS,CAAC;CAC/E,MAAM,aAAa,eAAwB,IAAI,wBAAwB,CAAC,CAAC,SAAS,CAAC;CAWnF,OAAO;EACL;EACA;EACA;EACA,aAdkB,eAAwB,IAAI,QAAQ,KAAK,IAAI,UAAU,CAczE;EACA;EACA,YAdiB,eAAgC;GACjD,IAAI,IAAI,QAAQ,GACd,OAAO;GACT,IAAI,IAAI,UAAU,GAChB,OAAO;EAEX,CAQE;CACF;AACF"}
|