@waggylabs/yumekit 0.2.0 → 0.2.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/dist/components/y-appbar.d.ts +21 -0
- package/dist/components/y-appbar.js +310 -22
- package/dist/components/y-badge.d.ts +5 -0
- package/dist/components/y-badge.js +5 -0
- package/dist/components/y-button.d.ts +6 -1
- package/dist/components/y-button.js +5 -0
- package/dist/components/y-checkbox.d.ts +7 -1
- package/dist/components/y-checkbox.js +6 -0
- package/dist/components/y-dialog.d.ts +11 -0
- package/dist/components/y-dialog.js +44 -25
- package/dist/components/y-drawer.js +1 -2
- package/dist/components/y-icon.d.ts +5 -0
- package/dist/components/y-icon.js +16 -8
- package/dist/components/y-input.d.ts +5 -0
- package/dist/components/y-input.js +6 -0
- package/dist/components/y-menu.d.ts +1 -0
- package/dist/components/y-menu.js +28 -1
- package/dist/components/y-panel.d.ts +10 -1
- package/dist/components/y-panel.js +21 -0
- package/dist/components/y-progress.d.ts +11 -0
- package/dist/components/y-progress.js +14 -0
- package/dist/components/y-radio.d.ts +11 -2
- package/dist/components/y-radio.js +3 -0
- package/dist/components/y-select.d.ts +19 -5
- package/dist/components/y-select.js +19 -0
- package/dist/components/y-slider.d.ts +11 -2
- package/dist/components/y-slider.js +10 -0
- package/dist/components/y-switch.d.ts +3 -0
- package/dist/components/y-switch.js +8 -2
- package/dist/components/y-table.d.ts +3 -0
- package/dist/components/y-table.js +4 -1
- package/dist/components/y-tabs.d.ts +14 -7
- package/dist/components/y-tabs.js +9 -0
- package/dist/components/y-theme.d.ts +6 -1
- package/dist/components/y-theme.js +11 -4
- package/dist/components/y-toast.d.ts +4 -0
- package/dist/components/y-toast.js +7 -0
- package/dist/components/y-tooltip.d.ts +6 -0
- package/dist/components/y-tooltip.js +8 -0
- package/dist/icons/all.js +42 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/index.js +528 -56
- package/dist/styles/variables.css +9 -6
- package/dist/yumekit.min.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var variablesCSS = "/* Colors */\n:root {\n --neutral--: #7f8286ff;\n --neutral-white: #ffffffff;\n --neutral-black: #000000ff;\n --neutral-light-0: #f7f7faff;\n --neutral-light-1: #f0f0f2ff;\n --neutral-light-2: #dfe0e3ff;\n --neutral-light-3: #cacbcfff;\n --neutral-light-4: #bbbdc0ff;\n --neutral-light-5: #acaeb2ff;\n --neutral-light-6: #9d9fa3ff;\n --neutral-light-7: #8e9195ff;\n --neutral-dark-0: #0c0c0dff;\n --neutral-dark-1: #151617ff;\n --neutral-dark-2: #292a2bff;\n --neutral-dark-3: #37383aff;\n --neutral-dark-4: #46474aff;\n --neutral-dark-5: #545659ff;\n --neutral-dark-6: #626568ff;\n --neutral-dark-7: #717377ff;\n --neutral-black-translucent: #0000001f;\n --neutral-white-translucent: #1111111f;\n --red--: #b80421ff;\n --red-light-0: #f2e6e8ff;\n --red-light-1: #ebcacfff;\n --red-light-2: #e4aeb6ff;\n --red-light-3: #dc919dff;\n --red-light-4: #d57585ff;\n --red-light-5: #ce596cff;\n --red-light-6: #c73d53ff;\n --red-light-7: #bf203aff;\n --red-dark-0: #0d0103ff;\n --red-dark-1: #220107ff;\n --red-dark-2: #38020bff;\n --red-dark-3: #4d020eff;\n --red-dark-4: #630312ff;\n --red-dark-5: #780316ff;\n --red-dark-6: #8d031aff;\n --red-dark-7: #a3041dff;\n --red-translucent: #b804211f;\n --orange--: #d13704ff;\n --orange-light-0: #f2e9e6ff;\n --orange-light-1: #eed3caff;\n --orange-light-2: #eabdaeff;\n --orange-light-3: #e6a691ff;\n --orange-light-4: #e29075ff;\n --orange-light-5: #dd7a59ff;\n --orange-light-6: #d9643dff;\n --orange-light-7: #d54d20ff;\n --orange-dark-0: #0d0300ff;\n --orange-dark-1: #260a01ff;\n --orange-dark-2: #3e1001ff;\n --orange-dark-3: #571702ff;\n --orange-dark-4: #6f1d02ff;\n --orange-dark-5: #882403ff;\n --orange-dark-6: #a02a03ff;\n --orange-dark-7: #b93104ff;\n --orange-translucent: #d137041f;\n --amber--: #d16004ff;\n --amber-light-0: #f2ece6ff;\n --amber-light-1: #eedbcaff;\n --amber-light-2: #eac9aeff;\n --amber-light-3: #e6b891ff;\n --amber-light-4: #e2a675ff;\n --amber-light-5: #dd9559ff;\n --amber-light-6: #d9833dff;\n --amber-light-7: #d57220ff;\n --amber-dark-0: #0d0c0cff;\n --amber-dark-1: #26170bff;\n --amber-dark-2: #3e210aff;\n --amber-dark-3: #572c09ff;\n --amber-dark-4: #6f3608ff;\n --amber-dark-5: #884107ff;\n --amber-dark-6: #a04b06ff;\n --amber-dark-7: #b95605ff;\n --amber-translucent: #d160041f;\n --yellow--: #d17f04ff;\n --yellow-light-0: #f2eadfff;\n --yellow-light-1: #eeddc4ff;\n --yellow-light-2: #eacfa8ff;\n --yellow-light-3: #e6c28dff;\n --yellow-light-4: #e2b572ff;\n --yellow-light-5: #dda756ff;\n --yellow-light-6: #d99a3bff;\n --yellow-light-7: #d58c1fff;\n --yellow-dark-0: #0d0c0cff;\n --yellow-dark-1: #261a0bff;\n --yellow-dark-2: #3e290aff;\n --yellow-dark-3: #573709ff;\n --yellow-dark-4: #6f4608ff;\n --yellow-dark-5: #885407ff;\n --yellow-dark-6: #a06206ff;\n --yellow-dark-7: #b97105ff;\n --yellow-translucent: #d17f041f;\n --lime--: #cad104ff;\n --lime-light-0: #f2f2dfff;\n --lime-light-1: #edeec4ff;\n --lime-light-2: #e8eaa8ff;\n --lime-light-3: #e3e68dff;\n --lime-light-4: #dee272ff;\n --lime-light-5: #d9dd56ff;\n --lime-light-6: #d4d93bff;\n --lime-light-7: #cfd51fff;\n --lime-dark-0: #0d0d0cff;\n --lime-dark-1: #25260bff;\n --lime-dark-2: #3c3e0aff;\n --lime-dark-3: #545709ff;\n --lime-dark-4: #6c6f08ff;\n --lime-dark-5: #838807ff;\n --lime-dark-6: #9ba006ff;\n --lime-dark-7: #b2b905ff;\n --lime-translucent: #cad1041f;\n --green--: #2dba73ff;\n --green-light-0: #e6f2ecff;\n --green-light-1: #cfebddff;\n --green-light-2: #b8e4ceff;\n --green-light-3: #a1ddbfff;\n --green-light-4: #8ad6b0ff;\n --green-light-5: #72cfa0ff;\n --green-light-6: #5bc891ff;\n --green-light-7: #44c182ff;\n --green-dark-0: #030d08ff;\n --green-dark-1: #082315ff;\n --green-dark-2: #0e3823ff;\n --green-dark-3: #134e30ff;\n --green-dark-4: #18643eff;\n --green-dark-5: #1d794bff;\n --green-dark-6: #238f58ff;\n --green-dark-7: #28a466ff;\n --green-translucent: #2dba731f;\n --teal--: #04b8b8ff;\n --teal-light-0: #f2fffeff;\n --teal-light-1: #d4f6f5ff;\n --teal-light-2: #b7ededff;\n --teal-light-3: #99e4e4ff;\n --teal-light-4: #7bdcdbff;\n --teal-light-5: #5dd3d2ff;\n --teal-light-6: #40cacaff;\n --teal-light-7: #22c1c1ff;\n --teal-dark-0: #0c0d0dff;\n --teal-dark-1: #0b2624ff;\n --teal-dark-2: #0a3e3cff;\n --teal-dark-3: #095753ff;\n --teal-dark-4: #086f6aff;\n --teal-dark-5: #078881ff;\n --teal-dark-6: #06a099ff;\n --teal-dark-7: #05b9b0ff;\n --teal-translucent: #04b8b81f;\n --blue--: #0576ffff;\n --blue-light-0: #ebf5ffff;\n --blue-light-1: #cee5ffff;\n --blue-light-2: #b2d5ffff;\n --blue-light-3: #95c5ffff;\n --blue-light-4: #78b6ffff;\n --blue-light-5: #5ba6ffff;\n --blue-light-6: #3f96ffff;\n --blue-light-7: #2286ffff;\n --blue-dark-0: #0c0c0dff;\n --blue-dark-1: #0b192bff;\n --blue-dark-2: #0a274aff;\n --blue-dark-3: #093468ff;\n --blue-dark-4: #094186ff;\n --blue-dark-5: #084ea4ff;\n --blue-dark-6: #075cc3ff;\n --blue-dark-7: #0669e1ff;\n --blue-translucent: #0576ff1f;\n --indigo--: #5405ffff;\n --indigo-light-0: #f6f2ffff;\n --indigo-light-1: #e2d4ffff;\n --indigo-light-2: #ceb7ffff;\n --indigo-light-3: #b999ffff;\n --indigo-light-4: #a57cffff;\n --indigo-light-5: #915effff;\n --indigo-light-6: #7d40ffff;\n --indigo-light-7: #6823ffff;\n --indigo-dark-0: #0d0c0cff;\n --indigo-dark-1: #160b2aff;\n --indigo-dark-2: #1f0a49ff;\n --indigo-dark-3: #280967ff;\n --indigo-dark-4: #310986ff;\n --indigo-dark-5: #3908a4ff;\n --indigo-dark-6: #4207c2ff;\n --indigo-dark-7: #4b06e1ff;\n --indigo-translucent: #5405ff1f;\n --purple--: #8a05ffff;\n --purple-light-0: #f9f2ffff;\n --purple-light-1: #ebd4ffff;\n --purple-light-2: #ddb7ffff;\n --purple-light-3: #cf99ffff;\n --purple-light-4: #c27cffff;\n --purple-light-5: #b45effff;\n --purple-light-6: #a640ffff;\n --purple-light-7: #9823ffff;\n --purple-dark-0: #0c0c0dff;\n --purple-dark-1: #1c0b2bff;\n --purple-dark-2: #2c0a4aff;\n --purple-dark-3: #3b0968ff;\n --purple-dark-4: #4b0986ff;\n --purple-dark-5: #5b08a4ff;\n --purple-dark-6: #6b07c3ff;\n --purple-dark-7: #7a06e1ff;\n --purple-translucent: #8a05ff1f;\n --pink--: #ff05a8ff;\n --pink-light-0: #f9f2ffff;\n --pink-light-1: #fad4f4ff;\n --pink-light-2: #fbb7e9ff;\n --pink-light-3: #fb99deff;\n --pink-light-4: #fc7cd4ff;\n --pink-light-5: #fd5ec9ff;\n --pink-light-6: #fe40beff;\n --pink-light-7: #fe23b3ff;\n --pink-dark-0: #0c0c0dff;\n --pink-dark-1: #2a0b20ff;\n --pink-dark-2: #490a34ff;\n --pink-dark-3: #670947ff;\n --pink-dark-4: #86095bff;\n --pink-dark-5: #a4086eff;\n --pink-dark-6: #c20781ff;\n --pink-dark-7: #e10695ff;\n --pink-translucent: #ff05a81f;\n --brown--: #ab642eff;\n --brown-light-0: #f2dfdfff;\n --brown-light-1: #e9d0c9ff;\n --brown-light-2: #e0c0b3ff;\n --brown-light-3: #d7b19dff;\n --brown-light-4: #cfa287ff;\n --brown-light-5: #c69270ff;\n --brown-light-6: #bd835aff;\n --brown-light-7: #b47344ff;\n --brown-dark-0: #0d0c0cff;\n --brown-dark-1: #211710ff;\n --brown-dark-2: #352215ff;\n --brown-dark-3: #482d19ff;\n --brown-dark-4: #5c381dff;\n --brown-dark-5: #704321ff;\n --brown-dark-6: #844e26ff;\n --brown-dark-7: #97592aff;\n --brown-translucent: #ab642e1f;\n}\n\n/* Numerics */\n:root {\n --border-none: 0px;\n --border-x-thin: 1px;\n --border-thin: 2px;\n --border-medium: 4px;\n --border-thick: 8px;\n --border-x-thick: 10px;\n --spacing-none: 0px;\n --spacing-4x-small: 1px;\n --spacing-2x-small: 2px;\n --spacing-x-small: 4px;\n --spacing-small: 6px;\n --spacing-medium: 8px;\n --spacing-large: 12px;\n --spacing-x-large: 16px;\n --spacing-2x-large: 24px;\n --spacing-4x-large: 32px;\n --font-size-display-1: 6em;\n --font-size-display-2: 5.5em;\n --font-size-display-3: 4.5em;\n --font-size-display-4: 3.5em;\n --font-size-h1: 2em;\n --font-size-h2: 1.5em;\n --font-size-h3: 1.17em;\n --font-size-h4: 1em;\n --font-size-h5: 0.83em;\n --font-size-paragraph: 1em;\n --font-size-small: 0.8em;\n --font-size-label: 0.83em;\n --font-size-button: 1em;\n --font-size-quote: 1.17em;\n --radii-none: 0px;\n --radii-x-small: 0.125em;\n --radii-small: 0.25em;\n --radii-medium: 0.375em;\n --radii-large: 0.5px;\n --radii-x-large: 1em;\n --radii-full: 9999px;\n --sizing-2x-small: 16px;\n --sizing-x-small: 19px;\n --sizing-small: 32px;\n --sizing-medium: 40px;\n --sizing-large: 56px;\n}\n\n/* Components */\n\n:root {\n /* appbar */\n --component-appbar-collapsed-width: 48px;\n --component-appbar-padding: var(--spacing-medium);\n --component-appbar-width: 240px;\n --component-appbar-z-index: 100;\n\n /* avatar */\n --component-avatar-border-radius-circle: var(--radii-full);\n --component-avatar-border-radius-square: var(--radii-small);\n --component-avatar-size-large: var(--sizing-large);\n --component-avatar-size-medium: var(--sizing-medium);\n --component-avatar-size-small: var(--sizing-small);\n\n /* badge */\n --component-badge-border-radius-circle: var(--radii-full);\n --component-badge-border-radius-square: var(--radii-small);\n --component-badge-padding-large: var(--spacing-small);\n --component-badge-padding-medium: var(--spacing-x-small);\n --component-badge-padding-small: var(--spacing-2x-small);\n --component-badge-size-large: var(--sizing-medium);\n --component-badge-size-medium: var(--sizing-small);\n --component-badge-size-small: var(--sizing-2x-small);\n\n /* button */\n --component-button-border-radius-inner: var(--radii-x-small);\n --component-button-border-radius-outer: var(--radii-small);\n --component-button-border-width: var(--border-thin);\n --component-button-border-width-2: var(--border-x-thin);\n --component-button-padding-large: var(--spacing-x-large);\n --component-button-padding-medium: var(--spacing-medium);\n --component-button-padding-small: var(--spacing-x-small);\n\n /* card */\n --component-card-border-radius-inner: var(--radii-small);\n --component-card-border-radius-outer: var(--radii-medium);\n --component-card-border-width: var(--border-x-thin);\n --component-card-inner-border-width: var(--border-x-thin);\n --component-card-padding-inner: var(--spacing-medium);\n --component-card-padding-outer: var(--spacing-x-large);\n\n /* checkbox */\n --component-checkbox-icon-size: var(--sizing-2x-small);\n --component-checkbox-size: var(--sizing-x-small);\n\n /* dialog */\n --component-dialog-border-radius-inner: var(--radii-x-small);\n --component-dialog-border-radius-outer: var(--radii-small);\n --component-dialog-border-width: var(--border-x-thin);\n --component-dialog-inner-border-width: var(--border-x-thin);\n --component-dialog-padding: var(--spacing-medium);\n --component-dialog-z-index: 1000;\n\n /* drawer */\n --component-drawer-border-radius: var(--radii-small);\n --component-drawer-border-width: var(--border-x-thin);\n --component-drawer-handle-padding: var(--spacing-x-small);\n --component-drawer-handle-width: var(--spacing-x-small);\n --component-drawer-padding: var(--spacing-medium);\n --component-drawer-z-index: 5000;\n\n /* icon */\n --component-icon-size-large: var(--spacing-4x-large);\n --component-icon-size-medium: var(--spacing-2x-large);\n --component-icon-size-small: var(--spacing-x-large);\n\n /* inputs */\n --component-inputs-border-radius-inner: var(--radii-x-small);\n --component-inputs-border-radius-outer: var(--radii-small);\n --component-inputs-border-width: var(--border-thin);\n --component-inputs-padding-large: var(--spacing-x-large);\n --component-inputs-padding-medium: var(--spacing-medium);\n --component-inputs-padding-small: var(--spacing-x-small);\n\n /* menu */\n --component-menu-border-radius: var(--radii-x-small);\n --component-menu-border-width: var(--border-x-thin);\n --component-menu-padding-horizontal: var(--spacing-small);\n --component-menu-padding-vertical: var(--spacing-x-small);\n --component-menu-z-index: 1001;\n\n /* panelbar */\n --component-panelbar-border-radius: var(--radii-x-small);\n --component-panelbar-border-width: var(--border-x-thin);\n --component-panelbar-indent: var(--spacing-x-large);\n --component-panelbar-padding: var(--spacing-medium);\n\n /* progress */\n --component-progress-border-radius-inner: var(--radii-small);\n --component-progress-border-radius-outer: calc(var(--radii-small) + 4px);\n --component-progress-border-width: var(--border-x-thin);\n --component-progress-padding: var(--spacing-x-small);\n --component-progress-size-large: var(--sizing-large);\n --component-progress-size-medium: var(--sizing-medium);\n --component-progress-size-small: var(--sizing-small);\n\n /* radio */\n --component-radio-dot-offset: var(--spacing-2x-small);\n --component-radio-dot-size: var(--spacing-medium);\n --component-radio-size: var(--sizing-2x-small);\n\n /* select */\n --component-select-z-index: 6000;\n\n /* sidebar */\n --component-sidebar-border-radius: var(--radii-small);\n --component-sidebar-border-width: var(--border-x-thin);\n\n /* slider */\n --component-slider-border-radius-inner: var(--radii-small);\n --component-slider-border-radius-outer: calc(var(--radii-small) + 4px);\n --component-slider-border-width: var(--border-x-thin);\n --component-slider-padding: var(--spacing-x-small);\n --component-slider-thumb-border-radius: var(--radii-x-small);\n\n /* switch */\n --component-switch-border-radius: var(--radii-full);\n --component-switch-border-width: var(--border-x-thin);\n --component-switch-padding: var(--spacing-2x-small);\n\n /* tab */\n --component-tab-border-radius-inner: var(--radii-x-small);\n --component-tab-border-radius-outer: var(--radii-small);\n --component-tab-border-width: var(--border-x-thin);\n --component-tab-content-padding: var(--spacing-large);\n --component-tab-gap-large: var(--spacing-large);\n --component-tab-gap-medium: var(--spacing-small);\n --component-tab-gap-small: var(--spacing-2x-small);\n --component-tab-padding-large: var(--spacing-2x-large);\n --component-tab-padding-medium: var(--spacing-large);\n --component-tab-padding-small: var(--spacing-small);\n\n /* table */\n --component-table-border-radius: var(--radii-small);\n --component-table-border-width: var(--border-x-thin);\n --component-table-border-width-header: var(--border-thin);\n --component-table-padding-large: var(--spacing-large);\n --component-table-padding-medium: var(--spacing-medium);\n --component-table-padding-small: var(--spacing-small);\n\n /* tag */\n --component-tag-border-radius-circle: var(--radii-full);\n --component-tag-border-radius-square: var(--radii-small);\n --component-tag-padding-large: var(--spacing-small);\n --component-tag-padding-medium: var(--spacing-x-small);\n --component-tag-padding-small: var(--spacing-2x-small);\n --component-tag-height-large: 38px;\n --component-tag-height-medium: 28px;\n --component-tag-height-small: 22px;\n --component-tag-size-large: var(--sizing-large);\n --component-tag-size-medium: var(--sizing-medium);\n --component-tag-size-small: var(--sizing-small);\n\n /* toast */\n --component-toast-border-radius: var(--radii-small);\n --component-toast-offset: var(--spacing-x-large);\n --component-toast-padding: var(--spacing-medium);\n --component-toast-padding-h: var(--spacing-x-large);\n --component-toast-z-index: 9000;\n\n /* tooltip */\n --component-tooltip-border-radius: var(--radii-small);\n --component-tooltip-padding: var(--spacing-x-small);\n --component-tooltip-padding-h: var(--spacing-medium);\n --component-tooltip-z-index: 7000;\n}\n\n/* Default Theme (Blue Light) */\n:root {\n --base-background-app: var(--neutral-light-1);\n --base-background-component: var(--neutral-light-0);\n --base-background-hover: var(--neutral-light-2);\n --base-background-border: var(--neutral-light-3);\n --base-background-active: var(--neutral-light-4);\n --base-content--: var(--neutral-dark-0);\n --base-content-inverse: var(--neutral-white);\n --base-content-light: var(--neutral-dark-1);\n --base-content-lighter: var(--neutral-dark-3);\n --base-content-lightest: var(--neutral-dark-5);\n --base-shadow: 0 2px 6px var(--neutral-black-translucent);\n --primary-background-app: var(--blue-light-1);\n --primary-background-component: var(--blue-light-0);\n --primary-background-hover: var(--blue-light-2);\n --primary-background-active: var(--blue-light-3);\n --primary-background-border: var(--blue-light-4);\n --primary-content--: var(--blue--);\n --primary-content-inverse: var(--neutral-white);\n --primary-content-hover: var(--blue-dark-7);\n --primary-content-active: var(--blue-dark-6);\n --secondary-background-app: var(--teal-light-1);\n --secondary-background-component: var(--teal-light-0);\n --secondary-background-hover: var(--teal-light-2);\n --secondary-background-border: var(--teal-light-3);\n --secondary-background-active: var(--teal-light-4);\n --secondary-content--: var(--teal--);\n --secondary-content-inverse: var(--neutral-black);\n --secondary-content-hover: var(--teal-dark-7);\n --secondary-content-active: var(--teal-dark-6);\n --success-background-app: var(--green-light-1);\n --success-background-component: var(--green-light-0);\n --success-background-hover: var(--green-light-2);\n --success-background-border: var(--green-light-3);\n --success-background-active: var(--green-light-4);\n --success-content--: var(--green--);\n --success-content-inverse: var(--neutral-black);\n --success-content-hover: var(--green-dark-7);\n --success-content-active: var(--green-dark-6);\n --warning-background-app: var(--yellow-light-1);\n --warning-background-component: var(--yellow-light-0);\n --warning-background-hover: var(--yellow-light-2);\n --warning-background-border: var(--yellow-light-3);\n --warning-background-active: var(--yellow-light-4);\n --warning-content--: var(--yellow--);\n --warning-content-inverse: var(--neutral-black);\n --warning-content-hover: var(--yellow-dark-7);\n --warning-content-active: var(--yellow-dark-6);\n --error-background-app: var(--red-light-1);\n --error-background-component: var(--red-light-0);\n --error-background-hover: var(--red-light-2);\n --error-background-border: var(--red-light-3);\n --error-background-active: var(--red-light-4);\n --error-content--: var(--red--);\n --error-content-inverse: var(--neutral-white);\n --error-content-hover: var(--red-dark-7);\n --error-content-active: var(--red-dark-6);\n --help-background-app: var(--indigo-light-1);\n --help-background-component: var(--indigo-light-0);\n --help-background-hover: var(--indigo-light-2);\n --help-background-active: var(--indigo-light-3);\n --help-background-border: var(--indigo-light-4);\n --help-content--: var(--indigo--);\n --help-content-inverse: var(--neutral-white);\n --help-content-hover: var(--indigo-dark-7);\n --help-content-active: var(--indigo-dark-6);\n --component-appbar-background: var(--base-background-component);\n --component-appbar-color: var(--base-content--);\n --component-appbar-border-color: var(--base-background-border);\n --component-appbar-border-width: var(--component-sidebar-border-width);\n --component-appbar-border-radius: var(--component-sidebar-border-radius);\n --component-appbar-inner-border-width: var(\n --component-sidebar-border-width\n );\n --component-checkbox-background: var(--base-background-component);\n --component-checkbox-color: var(--base-content--);\n --component-checkbox-border-color: var(--base-content--);\n --component-checkbox-accent: var(--primary-content--);\n --component-dialog-background: var(--base-background-component);\n --component-dialog-color: var(--base-content--);\n --component-dialog-border-color: var(--base-background-border);\n --component-dialog-hover-background: var(--base-background-hover);\n --component-dialog-accent: var(--primary-content--);\n --component-dialog-shadow: var(--base-shadow);\n --component-drawer-background: var(--base-background-component);\n --component-drawer-color: var(--base-content--);\n --component-drawer-border-color: var(--base-background-border);\n --component-drawer-hover-background: var(--base-background-hover);\n --component-input-background: var(--base-background-app);\n --component-input-background-disabled: var(--base-background-component);\n --component-input-color: var(--base-content--);\n --component-input-border-color: var(--base-background-border);\n --component-input-accent: var(--primary-content--);\n --component-input-label-color: var(--base-content-light);\n --component-input-icon-color: var(--base-content-lighter);\n --component-input-error-color: var(--error-content--);\n --component-input-error-background: var(--error-background-component);\n --component-input-error-border-color: var(--error-background-border);\n --component-menu-background: var(--base-background-component);\n --component-menu-color: var(--base-content--);\n --component-menu-border-color: var(--base-background-border);\n --component-menu-hover-background: var(--base-background-hover);\n --component-menu-shadow: var(--base-shadow);\n --component-panel-background: var(--base-background-component);\n --component-panel-color: var(--base-content--);\n --component-panel-expanded-background: var(--base-background-app);\n --component-panel-accent: var(--primary-content--);\n --component-panel-active-border: var(--base-background-active);\n --component-panel-accent-hover-background: var(--primary-background-active);\n --component-panel-hover-background: var(--base-background-hover);\n --component-radio-color: var(--base-content--);\n --component-radio-accent: var(--primary-content--);\n --component-select-background: var(--base-background-app);\n --component-select-color: var(--base-content--);\n --component-select-border-color: var(--base-background-border);\n --component-select-accent: var(--primary-content--);\n --component-select-accent-contrast: var(--base-background-component);\n --component-select-label-color: var(--base-content-light);\n --component-select-hover-background: var(--base-background-hover);\n --component-select-shadow: var(--base-shadow);\n --component-select-error-color: var(--error-content--);\n --component-select-error-background: var(--error-background-component);\n --component-select-error-border-color: var(--error-background-border);\n --component-table-color: var(--base-content--);\n --component-table-border-color: var(--base-background-border);\n --component-table-hover-background: var(--base-background-hover);\n --component-table-active-background: var(--base-background-active);\n --component-table-color-light: var(--base-content-lightest);\n --component-tabs-background: var(--base-background-component);\n --component-tabs-color: var(--base-content--);\n --component-tabs-border-color: var(--base-background-border);\n --component-tabs-accent: var(--primary-content--);\n --component-tabs-font-family: var(--font-family-body);\n --component-slider-width: 129px;\n --font-family-header: \"Lexend\", sans-serif;\n --font-family-body: \"Lexend\", sans-serif;\n}\n";
|
|
1
|
+
var variablesCSS = "/* Colors */\n:root {\n --neutral--: #7f8286ff;\n --neutral-white: #ffffffff;\n --neutral-black: #000000ff;\n --neutral-light-0: #f7f7faff;\n --neutral-light-1: #f0f0f2ff;\n --neutral-light-2: #dfe0e3ff;\n --neutral-light-3: #cacbcfff;\n --neutral-light-4: #bbbdc0ff;\n --neutral-light-5: #acaeb2ff;\n --neutral-light-6: #9d9fa3ff;\n --neutral-light-7: #8e9195ff;\n --neutral-dark-0: #0c0c0dff;\n --neutral-dark-1: #151617ff;\n --neutral-dark-2: #292a2bff;\n --neutral-dark-3: #37383aff;\n --neutral-dark-4: #46474aff;\n --neutral-dark-5: #545659ff;\n --neutral-dark-6: #626568ff;\n --neutral-dark-7: #717377ff;\n --neutral-black-translucent: #0000001f;\n --neutral-white-translucent: #1111111f;\n --red--: #b80421ff;\n --red-light-0: #f2e6e8ff;\n --red-light-1: #ebcacfff;\n --red-light-2: #e4aeb6ff;\n --red-light-3: #dc919dff;\n --red-light-4: #d57585ff;\n --red-light-5: #ce596cff;\n --red-light-6: #c73d53ff;\n --red-light-7: #bf203aff;\n --red-dark-0: #0d0103ff;\n --red-dark-1: #220107ff;\n --red-dark-2: #38020bff;\n --red-dark-3: #4d020eff;\n --red-dark-4: #630312ff;\n --red-dark-5: #780316ff;\n --red-dark-6: #8d031aff;\n --red-dark-7: #a3041dff;\n --red-translucent: #b804211f;\n --orange--: #d13704ff;\n --orange-light-0: #f2e9e6ff;\n --orange-light-1: #eed3caff;\n --orange-light-2: #eabdaeff;\n --orange-light-3: #e6a691ff;\n --orange-light-4: #e29075ff;\n --orange-light-5: #dd7a59ff;\n --orange-light-6: #d9643dff;\n --orange-light-7: #d54d20ff;\n --orange-dark-0: #0d0300ff;\n --orange-dark-1: #260a01ff;\n --orange-dark-2: #3e1001ff;\n --orange-dark-3: #571702ff;\n --orange-dark-4: #6f1d02ff;\n --orange-dark-5: #882403ff;\n --orange-dark-6: #a02a03ff;\n --orange-dark-7: #b93104ff;\n --orange-translucent: #d137041f;\n --amber--: #d16004ff;\n --amber-light-0: #f2ece6ff;\n --amber-light-1: #eedbcaff;\n --amber-light-2: #eac9aeff;\n --amber-light-3: #e6b891ff;\n --amber-light-4: #e2a675ff;\n --amber-light-5: #dd9559ff;\n --amber-light-6: #d9833dff;\n --amber-light-7: #d57220ff;\n --amber-dark-0: #0d0c0cff;\n --amber-dark-1: #26170bff;\n --amber-dark-2: #3e210aff;\n --amber-dark-3: #572c09ff;\n --amber-dark-4: #6f3608ff;\n --amber-dark-5: #884107ff;\n --amber-dark-6: #a04b06ff;\n --amber-dark-7: #b95605ff;\n --amber-translucent: #d160041f;\n --yellow--: #d17f04ff;\n --yellow-light-0: #f2eadfff;\n --yellow-light-1: #eeddc4ff;\n --yellow-light-2: #eacfa8ff;\n --yellow-light-3: #e6c28dff;\n --yellow-light-4: #e2b572ff;\n --yellow-light-5: #dda756ff;\n --yellow-light-6: #d99a3bff;\n --yellow-light-7: #d58c1fff;\n --yellow-dark-0: #0d0c0cff;\n --yellow-dark-1: #261a0bff;\n --yellow-dark-2: #3e290aff;\n --yellow-dark-3: #573709ff;\n --yellow-dark-4: #6f4608ff;\n --yellow-dark-5: #885407ff;\n --yellow-dark-6: #a06206ff;\n --yellow-dark-7: #b97105ff;\n --yellow-translucent: #d17f041f;\n --lime--: #cad104ff;\n --lime-light-0: #f2f2dfff;\n --lime-light-1: #edeec4ff;\n --lime-light-2: #e8eaa8ff;\n --lime-light-3: #e3e68dff;\n --lime-light-4: #dee272ff;\n --lime-light-5: #d9dd56ff;\n --lime-light-6: #d4d93bff;\n --lime-light-7: #cfd51fff;\n --lime-dark-0: #0d0d0cff;\n --lime-dark-1: #25260bff;\n --lime-dark-2: #3c3e0aff;\n --lime-dark-3: #545709ff;\n --lime-dark-4: #6c6f08ff;\n --lime-dark-5: #838807ff;\n --lime-dark-6: #9ba006ff;\n --lime-dark-7: #b2b905ff;\n --lime-translucent: #cad1041f;\n --green--: #2dba73ff;\n --green-light-0: #e6f2ecff;\n --green-light-1: #cfebddff;\n --green-light-2: #b8e4ceff;\n --green-light-3: #a1ddbfff;\n --green-light-4: #8ad6b0ff;\n --green-light-5: #72cfa0ff;\n --green-light-6: #5bc891ff;\n --green-light-7: #44c182ff;\n --green-dark-0: #030d08ff;\n --green-dark-1: #082315ff;\n --green-dark-2: #0e3823ff;\n --green-dark-3: #134e30ff;\n --green-dark-4: #18643eff;\n --green-dark-5: #1d794bff;\n --green-dark-6: #238f58ff;\n --green-dark-7: #28a466ff;\n --green-translucent: #2dba731f;\n --teal--: #04b8b8ff;\n --teal-light-0: #f2fffeff;\n --teal-light-1: #d4f6f5ff;\n --teal-light-2: #b7ededff;\n --teal-light-3: #99e4e4ff;\n --teal-light-4: #7bdcdbff;\n --teal-light-5: #5dd3d2ff;\n --teal-light-6: #40cacaff;\n --teal-light-7: #22c1c1ff;\n --teal-dark-0: #0c0d0dff;\n --teal-dark-1: #0b2624ff;\n --teal-dark-2: #0a3e3cff;\n --teal-dark-3: #095753ff;\n --teal-dark-4: #086f6aff;\n --teal-dark-5: #078881ff;\n --teal-dark-6: #06a099ff;\n --teal-dark-7: #05b9b0ff;\n --teal-translucent: #04b8b81f;\n --blue--: #0576ffff;\n --blue-light-0: #ebf5ffff;\n --blue-light-1: #cee5ffff;\n --blue-light-2: #b2d5ffff;\n --blue-light-3: #95c5ffff;\n --blue-light-4: #78b6ffff;\n --blue-light-5: #5ba6ffff;\n --blue-light-6: #3f96ffff;\n --blue-light-7: #2286ffff;\n --blue-dark-0: #0c0c0dff;\n --blue-dark-1: #0b192bff;\n --blue-dark-2: #0a274aff;\n --blue-dark-3: #093468ff;\n --blue-dark-4: #094186ff;\n --blue-dark-5: #084ea4ff;\n --blue-dark-6: #075cc3ff;\n --blue-dark-7: #0669e1ff;\n --blue-translucent: #0576ff1f;\n --indigo--: #5405ffff;\n --indigo-light-0: #f6f2ffff;\n --indigo-light-1: #e2d4ffff;\n --indigo-light-2: #ceb7ffff;\n --indigo-light-3: #b999ffff;\n --indigo-light-4: #a57cffff;\n --indigo-light-5: #915effff;\n --indigo-light-6: #7d40ffff;\n --indigo-light-7: #6823ffff;\n --indigo-dark-0: #0d0c0cff;\n --indigo-dark-1: #160b2aff;\n --indigo-dark-2: #1f0a49ff;\n --indigo-dark-3: #280967ff;\n --indigo-dark-4: #310986ff;\n --indigo-dark-5: #3908a4ff;\n --indigo-dark-6: #4207c2ff;\n --indigo-dark-7: #4b06e1ff;\n --indigo-translucent: #5405ff1f;\n --purple--: #8a05ffff;\n --purple-light-0: #f9f2ffff;\n --purple-light-1: #ebd4ffff;\n --purple-light-2: #ddb7ffff;\n --purple-light-3: #cf99ffff;\n --purple-light-4: #c27cffff;\n --purple-light-5: #b45effff;\n --purple-light-6: #a640ffff;\n --purple-light-7: #9823ffff;\n --purple-dark-0: #0c0c0dff;\n --purple-dark-1: #1c0b2bff;\n --purple-dark-2: #2c0a4aff;\n --purple-dark-3: #3b0968ff;\n --purple-dark-4: #4b0986ff;\n --purple-dark-5: #5b08a4ff;\n --purple-dark-6: #6b07c3ff;\n --purple-dark-7: #7a06e1ff;\n --purple-translucent: #8a05ff1f;\n --pink--: #ff05a8ff;\n --pink-light-0: #f9f2ffff;\n --pink-light-1: #fad4f4ff;\n --pink-light-2: #fbb7e9ff;\n --pink-light-3: #fb99deff;\n --pink-light-4: #fc7cd4ff;\n --pink-light-5: #fd5ec9ff;\n --pink-light-6: #fe40beff;\n --pink-light-7: #fe23b3ff;\n --pink-dark-0: #0c0c0dff;\n --pink-dark-1: #2a0b20ff;\n --pink-dark-2: #490a34ff;\n --pink-dark-3: #670947ff;\n --pink-dark-4: #86095bff;\n --pink-dark-5: #a4086eff;\n --pink-dark-6: #c20781ff;\n --pink-dark-7: #e10695ff;\n --pink-translucent: #ff05a81f;\n --brown--: #ab642eff;\n --brown-light-0: #f2dfdfff;\n --brown-light-1: #e9d0c9ff;\n --brown-light-2: #e0c0b3ff;\n --brown-light-3: #d7b19dff;\n --brown-light-4: #cfa287ff;\n --brown-light-5: #c69270ff;\n --brown-light-6: #bd835aff;\n --brown-light-7: #b47344ff;\n --brown-dark-0: #0d0c0cff;\n --brown-dark-1: #211710ff;\n --brown-dark-2: #352215ff;\n --brown-dark-3: #482d19ff;\n --brown-dark-4: #5c381dff;\n --brown-dark-5: #704321ff;\n --brown-dark-6: #844e26ff;\n --brown-dark-7: #97592aff;\n --brown-translucent: #ab642e1f;\n}\n\n/* Numerics */\n:root {\n --border-none: 0px;\n --border-x-thin: 1px;\n --border-thin: 2px;\n --border-medium: 4px;\n --border-thick: 8px;\n --border-x-thick: 10px;\n --spacing-none: 0px;\n --spacing-4x-small: 1px;\n --spacing-2x-small: 2px;\n --spacing-x-small: 4px;\n --spacing-small: 6px;\n --spacing-medium: 8px;\n --spacing-large: 12px;\n --spacing-x-large: 16px;\n --spacing-2x-large: 24px;\n --spacing-4x-large: 32px;\n --font-size-display-1: 6em;\n --font-size-display-2: 5.5em;\n --font-size-display-3: 4.5em;\n --font-size-display-4: 3.5em;\n --font-size-h1: 2em;\n --font-size-h2: 1.5em;\n --font-size-h3: 1.17em;\n --font-size-h4: 1em;\n --font-size-h5: 0.83em;\n --font-size-paragraph: 1em;\n --font-size-small: 0.8em;\n --font-size-label: 0.83em;\n --font-size-button: 1em;\n --font-size-quote: 1.17em;\n --radii-none: 0px;\n --radii-x-small: 0.125em;\n --radii-small: 0.25em;\n --radii-medium: 0.375em;\n --radii-large: 0.5px;\n --radii-x-large: 1em;\n --radii-full: 9999px;\n --sizing-2x-small: 16px;\n --sizing-x-small: 19px;\n --sizing-small: 32px;\n --sizing-medium: 40px;\n --sizing-large: 56px;\n}\n\n/* Components */\n\n:root {\n /* appbar */\n --component-appbar-collapsed-width: 52px;\n --component-appbar-mobile-breakpoint: 768px;\n --component-appbar-padding: var(--spacing-medium);\n --component-appbar-width: 240px;\n --component-appbar-z-index: 100;\n\n /* avatar */\n --component-avatar-border-radius-circle: var(--radii-full);\n --component-avatar-border-radius-square: var(--radii-small);\n --component-avatar-size-large: var(--sizing-large);\n --component-avatar-size-medium: var(--sizing-medium);\n --component-avatar-size-small: var(--sizing-small);\n\n /* badge */\n --component-badge-border-radius-circle: var(--radii-full);\n --component-badge-border-radius-square: var(--radii-small);\n --component-badge-padding-large: var(--spacing-small);\n --component-badge-padding-medium: var(--spacing-x-small);\n --component-badge-padding-small: var(--spacing-2x-small);\n --component-badge-size-large: var(--sizing-medium);\n --component-badge-size-medium: var(--sizing-small);\n --component-badge-size-small: var(--sizing-2x-small);\n\n /* button */\n --component-button-border-radius-inner: var(--radii-x-small);\n --component-button-border-radius-outer: var(--radii-small);\n --component-button-border-width: var(--border-thin);\n --component-button-border-width-2: var(--border-x-thin);\n --component-button-padding-large: var(--spacing-x-large);\n --component-button-padding-medium: var(--spacing-medium);\n --component-button-padding-small: var(--spacing-x-small);\n\n /* card */\n --component-card-border-radius-inner: var(--radii-small);\n --component-card-border-radius-outer: var(--radii-medium);\n --component-card-border-width: var(--border-x-thin);\n --component-card-inner-border-width: var(--border-x-thin);\n --component-card-padding-inner: var(--spacing-medium);\n --component-card-padding-outer: var(--spacing-x-large);\n\n /* checkbox */\n --component-checkbox-icon-size: var(--sizing-2x-small);\n --component-checkbox-size: var(--sizing-x-small);\n\n /* dialog */\n --component-dialog-border-radius-inner: var(--radii-x-small);\n --component-dialog-border-radius-outer: var(--radii-small);\n --component-dialog-border-width: var(--border-x-thin);\n --component-dialog-inner-border-width: var(--border-x-thin);\n --component-dialog-padding: var(--spacing-medium);\n --component-dialog-z-index: 1000;\n\n /* drawer */\n --component-drawer-border-radius: var(--radii-small);\n --component-drawer-border-width: var(--border-x-thin);\n --component-drawer-handle-padding: var(--spacing-x-small);\n --component-drawer-handle-width: var(--spacing-x-small);\n --component-drawer-padding: var(--spacing-medium);\n --component-drawer-z-index: 5000;\n\n /* icon */\n --component-icon-size-x-large: 28px;\n --component-icon-size-large: 22px;\n --component-icon-size-medium: 18px;\n --component-icon-size-small: 14px;\n --component-icon-size-x-small: 10px;\n\n /* inputs */\n --component-inputs-border-radius-inner: var(--radii-x-small);\n --component-inputs-border-radius-outer: var(--radii-small);\n --component-inputs-border-width: var(--border-thin);\n --component-inputs-padding-large: var(--spacing-x-large);\n --component-inputs-padding-medium: var(--spacing-medium);\n --component-inputs-padding-small: var(--spacing-x-small);\n\n /* menu */\n --component-menu-border-radius: var(--radii-x-small);\n --component-menu-border-width: var(--border-x-thin);\n --component-menu-padding-horizontal: var(--spacing-small);\n --component-menu-padding-vertical: var(--spacing-x-small);\n --component-menu-z-index: 1001;\n\n /* panelbar */\n --component-panelbar-border-radius: var(--radii-x-small);\n --component-panelbar-border-width: var(--border-x-thin);\n --component-panelbar-indent: var(--spacing-x-large);\n --component-panelbar-padding: var(--spacing-medium);\n\n /* progress */\n --component-progress-border-radius-inner: var(--radii-small);\n --component-progress-border-radius-outer: calc(var(--radii-small) + 4px);\n --component-progress-border-width: var(--border-x-thin);\n --component-progress-padding: var(--spacing-x-small);\n --component-progress-size-large: var(--sizing-large);\n --component-progress-size-medium: var(--sizing-medium);\n --component-progress-size-small: var(--sizing-small);\n\n /* radio */\n --component-radio-dot-offset: var(--spacing-2x-small);\n --component-radio-dot-size: var(--spacing-medium);\n --component-radio-size: var(--sizing-2x-small);\n\n /* select */\n --component-select-z-index: 6000;\n\n /* sidebar */\n --component-sidebar-border-radius: var(--radii-small);\n --component-sidebar-border-width: var(--border-x-thin);\n\n /* slider */\n --component-slider-border-radius-inner: var(--radii-small);\n --component-slider-border-radius-outer: calc(var(--radii-small) + 4px);\n --component-slider-border-width: var(--border-thin);\n --component-slider-padding: var(--spacing-x-small);\n --component-slider-thumb-border-radius: var(--radii-x-small);\n\n /* switch */\n --component-switch-border-radius: var(--radii-full);\n --component-switch-border-width: var(--border-thin);\n --component-switch-padding: var(--spacing-2x-small);\n\n /* tab */\n --component-tab-border-radius-inner: var(--radii-x-small);\n --component-tab-border-radius-outer: var(--radii-small);\n --component-tab-border-width: var(--border-x-thin);\n --component-tab-content-padding: var(--spacing-large);\n --component-tab-gap-large: var(--spacing-large);\n --component-tab-gap-medium: var(--spacing-small);\n --component-tab-gap-small: var(--spacing-2x-small);\n --component-tab-padding-large: var(--spacing-2x-large);\n --component-tab-padding-medium: var(--spacing-large);\n --component-tab-padding-small: var(--spacing-small);\n\n /* table */\n --component-table-border-radius: var(--radii-small);\n --component-table-border-width: var(--border-x-thin);\n --component-table-border-width-header: var(--border-thin);\n --component-table-padding-large: var(--spacing-large);\n --component-table-padding-medium: var(--spacing-medium);\n --component-table-padding-small: var(--spacing-small);\n\n /* tag */\n --component-tag-border-radius-circle: var(--radii-full);\n --component-tag-border-radius-square: var(--radii-small);\n --component-tag-padding-large: var(--spacing-small);\n --component-tag-padding-medium: var(--spacing-x-small);\n --component-tag-padding-small: var(--spacing-2x-small);\n --component-tag-height-large: 38px;\n --component-tag-height-medium: 28px;\n --component-tag-height-small: 22px;\n --component-tag-size-large: var(--sizing-large);\n --component-tag-size-medium: var(--sizing-medium);\n --component-tag-size-small: var(--sizing-small);\n\n /* toast */\n --component-toast-border-radius: var(--radii-small);\n --component-toast-offset: var(--spacing-x-large);\n --component-toast-padding: var(--spacing-medium);\n --component-toast-padding-h: var(--spacing-x-large);\n --component-toast-z-index: 9000;\n\n /* tooltip */\n --component-tooltip-border-radius: var(--radii-small);\n --component-tooltip-padding: var(--spacing-x-small);\n --component-tooltip-padding-h: var(--spacing-medium);\n --component-tooltip-z-index: 7000;\n}\n\n/* Default Theme (Blue Light) */\n:root {\n --base-background-app: var(--neutral-light-1);\n --base-background-component: var(--neutral-light-0);\n --base-background-hover: var(--neutral-light-2);\n --base-background-border: var(--neutral-light-3);\n --base-background-active: var(--neutral-light-4);\n --base-content--: var(--neutral-dark-0);\n --base-content-inverse: var(--neutral-white);\n --base-content-light: var(--neutral-dark-1);\n --base-content-lighter: var(--neutral-dark-3);\n --base-content-lightest: var(--neutral-dark-5);\n --base-shadow: 0 2px 6px var(--neutral-black-translucent);\n --primary-background-app: var(--blue-light-1);\n --primary-background-component: var(--blue-light-0);\n --primary-background-hover: var(--blue-light-2);\n --primary-background-active: var(--blue-light-3);\n --primary-background-border: var(--blue-light-4);\n --primary-content--: var(--blue--);\n --primary-content-inverse: var(--neutral-white);\n --primary-content-hover: var(--blue-dark-7);\n --primary-content-active: var(--blue-dark-6);\n --secondary-background-app: var(--teal-light-1);\n --secondary-background-component: var(--teal-light-0);\n --secondary-background-hover: var(--teal-light-2);\n --secondary-background-border: var(--teal-light-3);\n --secondary-background-active: var(--teal-light-4);\n --secondary-content--: var(--teal--);\n --secondary-content-inverse: var(--neutral-black);\n --secondary-content-hover: var(--teal-dark-7);\n --secondary-content-active: var(--teal-dark-6);\n --success-background-app: var(--green-light-1);\n --success-background-component: var(--green-light-0);\n --success-background-hover: var(--green-light-2);\n --success-background-border: var(--green-light-3);\n --success-background-active: var(--green-light-4);\n --success-content--: var(--green--);\n --success-content-inverse: var(--neutral-black);\n --success-content-hover: var(--green-dark-7);\n --success-content-active: var(--green-dark-6);\n --warning-background-app: var(--yellow-light-1);\n --warning-background-component: var(--yellow-light-0);\n --warning-background-hover: var(--yellow-light-2);\n --warning-background-border: var(--yellow-light-3);\n --warning-background-active: var(--yellow-light-4);\n --warning-content--: var(--yellow--);\n --warning-content-inverse: var(--neutral-black);\n --warning-content-hover: var(--yellow-dark-7);\n --warning-content-active: var(--yellow-dark-6);\n --error-background-app: var(--red-light-1);\n --error-background-component: var(--red-light-0);\n --error-background-hover: var(--red-light-2);\n --error-background-border: var(--red-light-3);\n --error-background-active: var(--red-light-4);\n --error-content--: var(--red--);\n --error-content-inverse: var(--neutral-white);\n --error-content-hover: var(--red-dark-7);\n --error-content-active: var(--red-dark-6);\n --help-background-app: var(--indigo-light-1);\n --help-background-component: var(--indigo-light-0);\n --help-background-hover: var(--indigo-light-2);\n --help-background-active: var(--indigo-light-3);\n --help-background-border: var(--indigo-light-4);\n --help-content--: var(--indigo--);\n --help-content-inverse: var(--neutral-white);\n --help-content-hover: var(--indigo-dark-7);\n --help-content-active: var(--indigo-dark-6);\n --component-appbar-background: var(--base-background-component);\n --component-appbar-color: var(--base-content--);\n --component-appbar-border-color: var(--base-background-border);\n --component-appbar-border-width: var(--component-sidebar-border-width);\n --component-appbar-border-radius: var(--component-sidebar-border-radius);\n --component-appbar-inner-border-width: var(\n --component-sidebar-border-width\n );\n --component-checkbox-background: var(--base-background-component);\n --component-checkbox-color: var(--base-content--);\n --component-checkbox-border-color: var(--base-content--);\n --component-checkbox-accent: var(--primary-content--);\n --component-dialog-background: var(--base-background-component);\n --component-dialog-color: var(--base-content--);\n --component-dialog-border-color: var(--base-background-border);\n --component-dialog-hover-background: var(--base-background-hover);\n --component-dialog-accent: var(--primary-content--);\n --component-dialog-shadow: var(--base-shadow);\n --component-drawer-background: var(--base-background-component);\n --component-drawer-color: var(--base-content--);\n --component-drawer-border-color: var(--base-background-border);\n --component-drawer-hover-background: var(--base-background-hover);\n --component-input-background: var(--base-background-app);\n --component-input-background-disabled: var(--base-background-component);\n --component-input-color: var(--base-content--);\n --component-input-border-color: var(--base-background-border);\n --component-input-accent: var(--primary-content--);\n --component-input-label-color: var(--base-content-light);\n --component-input-icon-color: var(--base-content-lighter);\n --component-input-error-color: var(--error-content--);\n --component-input-error-background: var(--error-background-component);\n --component-input-error-border-color: var(--error-background-border);\n --component-menu-background: var(--base-background-component);\n --component-menu-color: var(--base-content--);\n --component-menu-border-color: var(--base-background-border);\n --component-menu-hover-background: var(--base-background-hover);\n --component-menu-shadow: var(--base-shadow);\n --component-panel-background: var(--base-background-component);\n --component-panel-color: var(--base-content--);\n --component-panel-expanded-background: var(--base-background-app);\n --component-panel-accent: var(--primary-content--);\n --component-panel-active-border: var(--base-background-active);\n --component-panel-accent-hover-background: var(--primary-background-active);\n --component-panel-hover-background: var(--base-background-hover);\n --component-radio-color: var(--base-content--);\n --component-radio-accent: var(--primary-content--);\n --component-select-background: var(--base-background-app);\n --component-select-color: var(--base-content--);\n --component-select-border-color: var(--base-background-border);\n --component-select-accent: var(--primary-content--);\n --component-select-accent-contrast: var(--base-background-component);\n --component-select-label-color: var(--base-content-light);\n --component-select-hover-background: var(--base-background-hover);\n --component-select-shadow: var(--base-shadow);\n --component-select-error-color: var(--error-content--);\n --component-select-error-background: var(--error-background-component);\n --component-select-error-border-color: var(--error-background-border);\n --component-table-color: var(--base-content--);\n --component-table-border-color: var(--base-background-border);\n --component-table-hover-background: var(--base-background-hover);\n --component-table-active-background: var(--base-background-active);\n --component-table-color-light: var(--base-content-lightest);\n --component-tabs-background: var(--base-background-component);\n --component-tabs-color: var(--base-content--);\n --component-tabs-border-color: var(--base-background-border);\n --component-tabs-accent: var(--primary-content--);\n --component-tabs-font-family: var(--font-family-body);\n --component-slider-width: 129px;\n --font-family-header: \"Lexend\", sans-serif;\n --font-family-body: \"Lexend\", sans-serif;\n}\n";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Icon registry — a runtime map of icon names to SVG markup strings.
|
|
@@ -29,6 +29,8 @@ function getIcon(name) {
|
|
|
29
29
|
return icons.get(name) || "";
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
var accessibility = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"4\" r=\"1.5\"/>\n <path d=\"M7 8h10\"/>\n <path d=\"M12 8v4\"/>\n <path d=\"m8 20 4-8 4 8\"/>\n <path d=\"M7 16h10\"/>\n</svg>\n";
|
|
33
|
+
|
|
32
34
|
var ai = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M12 8V4H8\"/>\n <rect width=\"16\" height=\"12\" x=\"4\" y=\"8\" rx=\"2\"/>\n <path d=\"M2 14h2M20 14h2M15 13v2M9 13v2\"/>\n</svg>\n";
|
|
33
35
|
|
|
34
36
|
var arrowRight = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>\n <polyline points=\"12 5 19 12 12 19\"/>\n</svg>\n";
|
|
@@ -111,6 +113,8 @@ var diagram = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" f
|
|
|
111
113
|
|
|
112
114
|
var discord = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M20.317 4.492c-1.53-.69-3.17-1.2-4.885-1.49a.075.075 0 0 0-.079.036c-.21.369-.444.85-.608 1.23a18.566 18.566 0 0 0-5.487 0 12.36 12.36 0 0 0-.617-1.23A.077.077 0 0 0 8.562 3c-1.714.29-3.354.8-4.885 1.491a.07.07 0 0 0-.032.027C.533 9.093-.32 13.555.099 17.961a.08.08 0 0 0 .031.055 20.03 20.03 0 0 0 5.993 2.98.078.078 0 0 0 .084-.026c.462-.62.874-1.275 1.226-1.963.021-.04.001-.088-.041-.104a13.201 13.201 0 0 1-1.872-.878.075.075 0 0 1-.008-.125c.126-.093.252-.19.372-.287a.075.075 0 0 1 .078-.01c3.927 1.764 8.18 1.764 12.061 0a.075.075 0 0 1 .079.009c.12.098.245.195.372.288a.075.075 0 0 1-.006.125c-.598.344-1.22.635-1.873.877a.075.075 0 0 0-.041.105c.36.687.772 1.341 1.225 1.962a.077.077 0 0 0 .084.028 19.963 19.963 0 0 0 6.002-2.981.076.076 0 0 0 .032-.054c.5-5.094-.838-9.52-3.549-13.442a.06.06 0 0 0-.031-.028z\"/>\n</svg>\n";
|
|
113
115
|
|
|
116
|
+
var download = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/>\n <polyline points=\"7 10 12 15 17 10\"/>\n <line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"/>\n</svg>\n";
|
|
117
|
+
|
|
114
118
|
var expandRight$1 = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <polyline points=\"13 17 18 12 13 7\"/>\n <polyline points=\"6 17 11 12 6 7\"/>\n</svg>\n";
|
|
115
119
|
|
|
116
120
|
var features = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"3\"/>\n <path d=\"M12 1v4M12 19v4M4.22 4.22l2.83 2.83M16.95 16.95l2.83 2.83M1 12h4M19 12h4M4.22 19.78l2.83-2.83M16.95 7.05l2.83-2.83\"/>\n</svg>\n";
|
|
@@ -123,6 +127,10 @@ var folder = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fi
|
|
|
123
127
|
|
|
124
128
|
var github = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\"/>\n</svg>\n";
|
|
125
129
|
|
|
130
|
+
var globe = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\"/>\n <line x1=\"2\" y1=\"12\" x2=\"22\" y2=\"12\"/>\n <path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\"/>\n</svg>\n";
|
|
131
|
+
|
|
132
|
+
var grid = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"1\"/>\n <rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" rx=\"1\"/>\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\"/>\n <rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\"/>\n</svg>\n";
|
|
133
|
+
|
|
126
134
|
var home = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/>\n <polyline points=\"9 22 9 12 15 12 15 22\"/>\n</svg>\n";
|
|
127
135
|
|
|
128
136
|
var image = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/>\n <circle cx=\"8.5\" cy=\"8.5\" r=\"1.5\"/>\n <polyline points=\"21 15 16 10 5 21\"/>\n</svg>\n";
|
|
@@ -131,28 +139,48 @@ var indeterminate$1 = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 2
|
|
|
131
139
|
|
|
132
140
|
var layout = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/>\n <line x1=\"3\" y1=\"9\" x2=\"21\" y2=\"9\"/>\n <line x1=\"9\" y1=\"21\" x2=\"9\" y2=\"9\"/>\n</svg>\n";
|
|
133
141
|
|
|
142
|
+
var leftFromBracket = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\"/>\n <polyline points=\"14 7 9 12 14 17\"/>\n <line x1=\"9\" y1=\"12\" x2=\"21\" y2=\"12\"/>\n</svg>\n";
|
|
143
|
+
|
|
144
|
+
var leftToBracket = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\"/>\n <polyline points=\"16 17 21 12 16 7\"/>\n <line x1=\"21\" y1=\"12\" x2=\"9\" y2=\"12\"/>\n</svg>\n";
|
|
145
|
+
|
|
134
146
|
var listCheck = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"10\" y1=\"6\" x2=\"21\" y2=\"6\"/>\n <line x1=\"10\" y1=\"12\" x2=\"21\" y2=\"12\"/>\n <line x1=\"10\" y1=\"18\" x2=\"21\" y2=\"18\"/>\n <polyline points=\"3 6 4 7 6 5\"/>\n <polyline points=\"3 12 4 13 6 11\"/>\n <polyline points=\"3 18 4 19 6 17\"/>\n</svg>\n";
|
|
135
147
|
|
|
148
|
+
var lock = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"3\" y=\"11\" width=\"18\" height=\"11\" rx=\"2\" ry=\"2\"/>\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\"/>\n</svg>\n";
|
|
149
|
+
|
|
136
150
|
var logo = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M12 2L2 7l10 5 10-5-10-5z\"/>\n <path d=\"M2 17l10 5 10-5\"/>\n <path d=\"M2 12l10 5 10-5\"/>\n</svg>\n";
|
|
137
151
|
|
|
138
152
|
var mail = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\"/>\n <path d=\"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7\"/>\n</svg>\n";
|
|
139
153
|
|
|
154
|
+
var menu$1 = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"4\" y1=\"6\" x2=\"20\" y2=\"6\"/>\n <line x1=\"4\" y1=\"12\" x2=\"20\" y2=\"12\"/>\n <line x1=\"4\" y1=\"18\" x2=\"20\" y2=\"18\"/>\n</svg>\n";
|
|
155
|
+
|
|
140
156
|
var moon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z\"/>\n</svg>\n";
|
|
141
157
|
|
|
142
158
|
var palette = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"13.5\" cy=\"6.5\" r=\"1.5\"/>\n <circle cx=\"17.5\" cy=\"10.5\" r=\"1.5\"/>\n <circle cx=\"8.5\" cy=\"7.5\" r=\"1.5\"/>\n <circle cx=\"6.5\" cy=\"12.5\" r=\"1.5\"/>\n <path d=\"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z\"/>\n</svg>\n";
|
|
143
159
|
|
|
144
160
|
var plus = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/>\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>\n</svg>\n";
|
|
145
161
|
|
|
162
|
+
var puzzle = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.707-1.704L4.23 8.77a.979.979 0 0 1 .837-.276c.47.07.802.48.968.925a2.501 2.501 0 1 0 3.214-3.214c-.446-.166-.855-.497-.925-.968a.979.979 0 0 1 .276-.837l1.627-1.627a2.404 2.404 0 0 1 3.409 0l1.568 1.568c.219.22.556.328.878.29.493-.075.84-.505 1.02-.969a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.968 1.02z\"/>\n</svg>\n";
|
|
163
|
+
|
|
164
|
+
var rightFromBracket = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4\"/>\n <polyline points=\"8 7 3 12 8 17\"/>\n <line x1=\"3\" y1=\"12\" x2=\"15\" y2=\"12\"/>\n</svg>\n";
|
|
165
|
+
|
|
166
|
+
var rightToBracket = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4\"/>\n <polyline points=\"10 17 15 12 10 7\"/>\n <line x1=\"15\" y1=\"12\" x2=\"3\" y2=\"12\"/>\n</svg>\n";
|
|
167
|
+
|
|
146
168
|
var save = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z\"/>\n <polyline points=\"17 21 17 13 7 13 7 21\"/>\n <polyline points=\"7 3 7 8 15 8\"/>\n</svg>\n";
|
|
147
169
|
|
|
148
170
|
var search = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"11\" cy=\"11\" r=\"8\"/>\n <path d=\"m21 21-4.35-4.35\"/>\n</svg>\n";
|
|
149
171
|
|
|
150
172
|
var settings = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"3\"/>\n <path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z\"/>\n</svg>\n";
|
|
151
173
|
|
|
174
|
+
var shield = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"/>\n</svg>\n";
|
|
175
|
+
|
|
152
176
|
var star = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\"/>\n</svg>\n";
|
|
153
177
|
|
|
154
178
|
var sun = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"5\"/>\n <path d=\"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42\"/>\n</svg>\n";
|
|
155
179
|
|
|
180
|
+
var swap = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <polyline points=\"16 3 21 3 21 8\"/>\n <line x1=\"4\" y1=\"20\" x2=\"21\" y2=\"3\"/>\n <polyline points=\"21 16 21 21 16 21\"/>\n <line x1=\"15\" y1=\"15\" x2=\"21\" y2=\"21\"/>\n <line x1=\"4\" y1=\"4\" x2=\"9\" y2=\"9\"/>\n</svg>\n";
|
|
181
|
+
|
|
182
|
+
var upload = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/>\n <polyline points=\"17 8 12 3 7 8\"/>\n <line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\"/>\n</svg>\n";
|
|
183
|
+
|
|
156
184
|
var user = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2\"/>\n <circle cx=\"12\" cy=\"7\" r=\"4\"/>\n</svg>\n";
|
|
157
185
|
|
|
158
186
|
var users = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2\"/>\n <circle cx=\"9\" cy=\"7\" r=\"4\"/>\n <path d=\"M23 21v-2a4 4 0 0 0-3-3.87\"/>\n <path d=\"M16 3.13a4 4 0 0 1 0 7.75\"/>\n</svg>\n";
|
|
@@ -169,6 +197,7 @@ var warning = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" f
|
|
|
169
197
|
|
|
170
198
|
|
|
171
199
|
registerIcons({
|
|
200
|
+
accessibility,
|
|
172
201
|
ai,
|
|
173
202
|
"arrow-right": arrowRight,
|
|
174
203
|
"arrow-up": arrowUp,
|
|
@@ -210,27 +239,40 @@ registerIcons({
|
|
|
210
239
|
compass,
|
|
211
240
|
diagram,
|
|
212
241
|
discord,
|
|
242
|
+
download,
|
|
213
243
|
"expand-right": expandRight$1,
|
|
214
244
|
features,
|
|
215
245
|
figma,
|
|
216
246
|
filter,
|
|
217
247
|
folder,
|
|
218
248
|
github,
|
|
249
|
+
globe,
|
|
250
|
+
grid,
|
|
219
251
|
home,
|
|
220
252
|
image,
|
|
221
253
|
indeterminate: indeterminate$1,
|
|
222
254
|
layout,
|
|
255
|
+
"left-from-bracket": leftFromBracket,
|
|
256
|
+
"left-to-bracket": leftToBracket,
|
|
223
257
|
"list-check": listCheck,
|
|
258
|
+
lock,
|
|
224
259
|
logo,
|
|
225
260
|
mail,
|
|
261
|
+
menu: menu$1,
|
|
226
262
|
moon,
|
|
227
263
|
palette,
|
|
228
264
|
plus,
|
|
265
|
+
puzzle,
|
|
266
|
+
"right-from-bracket": rightFromBracket,
|
|
267
|
+
"right-to-bracket": rightToBracket,
|
|
229
268
|
save,
|
|
230
269
|
search,
|
|
231
270
|
settings,
|
|
271
|
+
shield,
|
|
232
272
|
star,
|
|
233
273
|
sun,
|
|
274
|
+
swap,
|
|
275
|
+
upload,
|
|
234
276
|
user,
|
|
235
277
|
users,
|
|
236
278
|
warning,
|
|
@@ -293,6 +335,7 @@ class YumeButton extends HTMLElement {
|
|
|
293
335
|
}
|
|
294
336
|
}
|
|
295
337
|
|
|
338
|
+
/** The current selected value(s), comma-separated when 'multiple' is set. */
|
|
296
339
|
get value() {
|
|
297
340
|
if (this.hasAttribute("multiple")) {
|
|
298
341
|
return Array.from(this.selectedValues).join(",");
|
|
@@ -323,6 +366,10 @@ class YumeButton extends HTMLElement {
|
|
|
323
366
|
this.setAttribute("value", newVal);
|
|
324
367
|
}
|
|
325
368
|
|
|
369
|
+
/**
|
|
370
|
+
* Sets the button options from an array of objects.
|
|
371
|
+
* @param {Array<Object>} options
|
|
372
|
+
*/
|
|
326
373
|
setOptions(options) {
|
|
327
374
|
this.setAttribute("options", JSON.stringify(options));
|
|
328
375
|
}
|
|
@@ -900,7 +947,6 @@ function sanitizeSvg(raw) {
|
|
|
900
947
|
}
|
|
901
948
|
};
|
|
902
949
|
|
|
903
|
-
// Sanitize the <svg> element's own attributes
|
|
904
950
|
for (const attr of [...svg.attributes]) {
|
|
905
951
|
if (!ALLOWED_ATTRS.has(attr.name.toLowerCase())) {
|
|
906
952
|
svg.removeAttribute(attr.name);
|
|
@@ -942,6 +988,7 @@ class YumeIcon extends HTMLElement {
|
|
|
942
988
|
this.render();
|
|
943
989
|
}
|
|
944
990
|
|
|
991
|
+
/** The registered icon name to display. */
|
|
945
992
|
get name() {
|
|
946
993
|
return this.getAttribute("name") || "";
|
|
947
994
|
}
|
|
@@ -949,6 +996,7 @@ class YumeIcon extends HTMLElement {
|
|
|
949
996
|
this.setAttribute("name", val);
|
|
950
997
|
}
|
|
951
998
|
|
|
999
|
+
/** Icon size: "small" | "medium" | "large" (default "medium"). */
|
|
952
1000
|
get size() {
|
|
953
1001
|
return this.getAttribute("size") || "medium";
|
|
954
1002
|
}
|
|
@@ -956,6 +1004,7 @@ class YumeIcon extends HTMLElement {
|
|
|
956
1004
|
this.setAttribute("size", val);
|
|
957
1005
|
}
|
|
958
1006
|
|
|
1007
|
+
/** Color theme: "base" | "primary" | "secondary" | "success" | "warning" | "error" | "help". */
|
|
959
1008
|
get color() {
|
|
960
1009
|
return this.getAttribute("color") || "";
|
|
961
1010
|
}
|
|
@@ -964,6 +1013,7 @@ class YumeIcon extends HTMLElement {
|
|
|
964
1013
|
else this.removeAttribute("color");
|
|
965
1014
|
}
|
|
966
1015
|
|
|
1016
|
+
/** Accessible label for the icon. When set, the icon gets role="img". */
|
|
967
1017
|
get label() {
|
|
968
1018
|
return this.getAttribute("label") || "";
|
|
969
1019
|
}
|
|
@@ -972,8 +1022,9 @@ class YumeIcon extends HTMLElement {
|
|
|
972
1022
|
else this.removeAttribute("label");
|
|
973
1023
|
}
|
|
974
1024
|
|
|
1025
|
+
/** Stroke weight: "thin" | "regular" | "thick". */
|
|
975
1026
|
get weight() {
|
|
976
|
-
return this.getAttribute("weight") || "";
|
|
1027
|
+
return this.getAttribute("weight") || "regular";
|
|
977
1028
|
}
|
|
978
1029
|
set weight(val) {
|
|
979
1030
|
if (val) this.setAttribute("weight", val);
|
|
@@ -995,18 +1046,22 @@ class YumeIcon extends HTMLElement {
|
|
|
995
1046
|
|
|
996
1047
|
_getSize(size) {
|
|
997
1048
|
const map = {
|
|
998
|
-
small: "var(--component-icon-size-small,
|
|
999
|
-
|
|
1000
|
-
|
|
1049
|
+
"x-small": "var(--component-icon-size-x-small, 10px)",
|
|
1050
|
+
small: "var(--component-icon-size-small, 14px)",
|
|
1051
|
+
medium: "var(--component-icon-size-medium, 18px)",
|
|
1052
|
+
large: "var(--component-icon-size-large, 22px)",
|
|
1053
|
+
"x-large": "var(--component-icon-size-x-large, 28px)",
|
|
1001
1054
|
};
|
|
1002
1055
|
return map[size] || map.medium;
|
|
1003
1056
|
}
|
|
1004
1057
|
|
|
1005
1058
|
_getWeight(weight) {
|
|
1006
1059
|
const map = {
|
|
1007
|
-
thin: "1",
|
|
1008
|
-
|
|
1009
|
-
|
|
1060
|
+
"x-thin": "1",
|
|
1061
|
+
thin: "1.5",
|
|
1062
|
+
regular: "2",
|
|
1063
|
+
thick: "2.5",
|
|
1064
|
+
"x-thick": "3",
|
|
1010
1065
|
};
|
|
1011
1066
|
return map[weight] || "";
|
|
1012
1067
|
}
|
|
@@ -1074,11 +1129,14 @@ class YumeMenu extends HTMLElement {
|
|
|
1074
1129
|
|
|
1075
1130
|
connectedCallback() {
|
|
1076
1131
|
if (!this.hasAttribute("items")) this.items = [];
|
|
1132
|
+
|
|
1077
1133
|
this._setupAnchor();
|
|
1078
1134
|
this.render();
|
|
1135
|
+
|
|
1079
1136
|
document.addEventListener("click", this._onDocumentClick);
|
|
1080
1137
|
window.addEventListener("scroll", this._onScrollOrResize, true);
|
|
1081
1138
|
window.addEventListener("resize", this._onScrollOrResize);
|
|
1139
|
+
|
|
1082
1140
|
this.style.position = "fixed";
|
|
1083
1141
|
this.style.zIndex = "1000";
|
|
1084
1142
|
this.style.display = "none";
|
|
@@ -1086,6 +1144,7 @@ class YumeMenu extends HTMLElement {
|
|
|
1086
1144
|
|
|
1087
1145
|
disconnectedCallback() {
|
|
1088
1146
|
this._teardownAnchor();
|
|
1147
|
+
|
|
1089
1148
|
document.removeEventListener("click", this._onDocumentClick);
|
|
1090
1149
|
window.removeEventListener("scroll", this._onScrollOrResize, true);
|
|
1091
1150
|
window.removeEventListener("resize", this._onScrollOrResize);
|
|
@@ -1093,14 +1152,18 @@ class YumeMenu extends HTMLElement {
|
|
|
1093
1152
|
|
|
1094
1153
|
attributeChangedCallback(name, oldVal, newVal) {
|
|
1095
1154
|
if (oldVal === newVal) return;
|
|
1155
|
+
|
|
1096
1156
|
if (name === "items" || name === "size") this.render();
|
|
1157
|
+
|
|
1097
1158
|
if (name === "anchor") {
|
|
1098
1159
|
this._teardownAnchor();
|
|
1099
1160
|
this._setupAnchor();
|
|
1100
1161
|
}
|
|
1162
|
+
|
|
1101
1163
|
if (name === "visible") {
|
|
1102
1164
|
this._updatePosition();
|
|
1103
1165
|
}
|
|
1166
|
+
|
|
1104
1167
|
if (name === "direction") {
|
|
1105
1168
|
this._updatePosition();
|
|
1106
1169
|
}
|
|
@@ -1211,9 +1274,20 @@ class YumeMenu extends HTMLElement {
|
|
|
1211
1274
|
|
|
1212
1275
|
_onAnchorClick(e) {
|
|
1213
1276
|
e.stopPropagation();
|
|
1277
|
+
if (!this.visible) {
|
|
1278
|
+
YumeMenu._closeAll(this);
|
|
1279
|
+
}
|
|
1214
1280
|
this.visible = !this.visible;
|
|
1215
1281
|
}
|
|
1216
1282
|
|
|
1283
|
+
static _closeAll(except) {
|
|
1284
|
+
document.querySelectorAll("y-menu").forEach((menu) => {
|
|
1285
|
+
if (menu !== except && menu.visible) {
|
|
1286
|
+
menu.visible = false;
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1217
1291
|
_onDocumentClick(e) {
|
|
1218
1292
|
const path = e.composedPath();
|
|
1219
1293
|
if (this._anchorEl && path.includes(this._anchorEl)) return;
|
|
@@ -1253,7 +1327,13 @@ class YumeMenu extends HTMLElement {
|
|
|
1253
1327
|
}
|
|
1254
1328
|
|
|
1255
1329
|
const anchorRect = this._anchorEl.getBoundingClientRect();
|
|
1330
|
+
|
|
1331
|
+
// Temporarily show off-screen to measure actual dimensions
|
|
1332
|
+
this.style.visibility = "hidden";
|
|
1333
|
+
this.style.display = "block";
|
|
1256
1334
|
const menuRect = this.getBoundingClientRect();
|
|
1335
|
+
this.style.visibility = "";
|
|
1336
|
+
|
|
1257
1337
|
const vw = window.innerWidth;
|
|
1258
1338
|
const vh = window.innerHeight;
|
|
1259
1339
|
|
|
@@ -1314,8 +1394,8 @@ class YumeMenu extends HTMLElement {
|
|
|
1314
1394
|
this.shadowRoot.innerHTML = "";
|
|
1315
1395
|
|
|
1316
1396
|
const paddingVar = `var(--component-button-padding-${this.size}, 0.5rem)`;
|
|
1317
|
-
|
|
1318
1397
|
const style = document.createElement("style");
|
|
1398
|
+
|
|
1319
1399
|
style.textContent = `
|
|
1320
1400
|
ul.menu,
|
|
1321
1401
|
ul.submenu {
|
|
@@ -1368,12 +1448,14 @@ class YumeMenu extends HTMLElement {
|
|
|
1368
1448
|
flex: 1;
|
|
1369
1449
|
}
|
|
1370
1450
|
`;
|
|
1451
|
+
|
|
1371
1452
|
this.shadowRoot.appendChild(style);
|
|
1372
1453
|
|
|
1373
1454
|
const rootUl = this._createMenuList(this.items);
|
|
1374
1455
|
rootUl.classList.add("menu");
|
|
1375
1456
|
rootUl.setAttribute("role", "menu");
|
|
1376
1457
|
rootUl.setAttribute("part", "menu");
|
|
1458
|
+
|
|
1377
1459
|
this.shadowRoot.appendChild(rootUl);
|
|
1378
1460
|
}
|
|
1379
1461
|
}
|
|
@@ -1411,6 +1493,10 @@ const checkmark = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><
|
|
|
1411
1493
|
|
|
1412
1494
|
const indeterminate = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="4" y="11" width="16" height="2" rx="1" ry="1" fill="currentColor"/></svg>`;
|
|
1413
1495
|
|
|
1496
|
+
/* ── Menu (hamburger) ────────────────────────────────────────────── */
|
|
1497
|
+
|
|
1498
|
+
const menu = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="6" x2="20" y2="6"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/></svg>`;
|
|
1499
|
+
|
|
1414
1500
|
/* ── Close / remove ───────────────────────────────────────────────── */
|
|
1415
1501
|
|
|
1416
1502
|
const close = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="14" height="14" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round"><line x1="6" y1="6" x2="14" y2="14" /><line x1="14" y1="6" x2="6" y2="14" /></svg>`;
|
|
@@ -1456,6 +1542,7 @@ class YumeAppbar extends HTMLElement {
|
|
|
1456
1542
|
"size",
|
|
1457
1543
|
"menu-direction",
|
|
1458
1544
|
"sticky",
|
|
1545
|
+
"mobile-breakpoint",
|
|
1459
1546
|
];
|
|
1460
1547
|
}
|
|
1461
1548
|
|
|
@@ -1463,17 +1550,26 @@ class YumeAppbar extends HTMLElement {
|
|
|
1463
1550
|
super();
|
|
1464
1551
|
this.attachShadow({ mode: "open" });
|
|
1465
1552
|
this._onCollapseClick = this._onCollapseClick.bind(this);
|
|
1553
|
+
this._onMediaChange = this._onMediaChange.bind(this);
|
|
1466
1554
|
this._idCounter = 0;
|
|
1555
|
+
this._mql = null;
|
|
1556
|
+
this._isMobile = false;
|
|
1467
1557
|
}
|
|
1468
1558
|
|
|
1469
1559
|
connectedCallback() {
|
|
1560
|
+
this._setupMediaQuery();
|
|
1470
1561
|
this.render();
|
|
1471
1562
|
}
|
|
1472
1563
|
|
|
1473
|
-
disconnectedCallback() {
|
|
1564
|
+
disconnectedCallback() {
|
|
1565
|
+
this._teardownMediaQuery();
|
|
1566
|
+
}
|
|
1474
1567
|
|
|
1475
1568
|
attributeChangedCallback(name, oldVal, newVal) {
|
|
1476
1569
|
if (oldVal === newVal) return;
|
|
1570
|
+
if (name === "mobile-breakpoint" || name === "orientation") {
|
|
1571
|
+
this._setupMediaQuery();
|
|
1572
|
+
}
|
|
1477
1573
|
this.render();
|
|
1478
1574
|
}
|
|
1479
1575
|
|
|
@@ -1531,6 +1627,23 @@ class YumeAppbar extends HTMLElement {
|
|
|
1531
1627
|
else this.removeAttribute("sticky");
|
|
1532
1628
|
}
|
|
1533
1629
|
|
|
1630
|
+
/**
|
|
1631
|
+
* Override the mobile breakpoint (in pixels) for this instance.
|
|
1632
|
+
* Falls back to the CSS variable --component-appbar-mobile-breakpoint (default 768).
|
|
1633
|
+
*/
|
|
1634
|
+
get mobileBreakpoint() {
|
|
1635
|
+
return this.getAttribute("mobile-breakpoint") || "";
|
|
1636
|
+
}
|
|
1637
|
+
set mobileBreakpoint(val) {
|
|
1638
|
+
if (val) this.setAttribute("mobile-breakpoint", val);
|
|
1639
|
+
else this.removeAttribute("mobile-breakpoint");
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
/** Whether the appbar is currently rendering in mobile mode. */
|
|
1643
|
+
get mobile() {
|
|
1644
|
+
return this._isMobile;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1534
1647
|
toggle() {
|
|
1535
1648
|
this.collapsed = !this.collapsed;
|
|
1536
1649
|
}
|
|
@@ -1553,7 +1666,228 @@ class YumeAppbar extends HTMLElement {
|
|
|
1553
1666
|
return false;
|
|
1554
1667
|
}
|
|
1555
1668
|
|
|
1669
|
+
_getBreakpointPx() {
|
|
1670
|
+
const attr = this.mobileBreakpoint;
|
|
1671
|
+
if (attr) {
|
|
1672
|
+
const px = parseInt(attr, 10);
|
|
1673
|
+
if (!isNaN(px) && px > 0) return px;
|
|
1674
|
+
}
|
|
1675
|
+
const cssVal = getComputedStyle(document.documentElement)
|
|
1676
|
+
.getPropertyValue("--component-appbar-mobile-breakpoint")
|
|
1677
|
+
.trim();
|
|
1678
|
+
if (cssVal) {
|
|
1679
|
+
const px = parseInt(cssVal, 10);
|
|
1680
|
+
if (!isNaN(px) && px > 0) return px;
|
|
1681
|
+
}
|
|
1682
|
+
return 768;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
_setupMediaQuery() {
|
|
1686
|
+
this._teardownMediaQuery();
|
|
1687
|
+
if (this.orientation !== "horizontal") {
|
|
1688
|
+
this._isMobile = false;
|
|
1689
|
+
return;
|
|
1690
|
+
}
|
|
1691
|
+
const bp = this._getBreakpointPx();
|
|
1692
|
+
this._mql = window.matchMedia(`(max-width: ${bp}px)`);
|
|
1693
|
+
this._isMobile = this._mql.matches;
|
|
1694
|
+
this._mql.addEventListener("change", this._onMediaChange);
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
_teardownMediaQuery() {
|
|
1698
|
+
if (this._mql) {
|
|
1699
|
+
this._mql.removeEventListener("change", this._onMediaChange);
|
|
1700
|
+
this._mql = null;
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
_onMediaChange(e) {
|
|
1705
|
+
this._isMobile = e.matches;
|
|
1706
|
+
this.render();
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* Convert appbar nav items to y-menu item format.
|
|
1711
|
+
* Maps `href` → `url` and recursively converts children.
|
|
1712
|
+
*/
|
|
1713
|
+
_toMenuItems(items) {
|
|
1714
|
+
return items.map((item) => {
|
|
1715
|
+
const mi = { text: item.text || "" };
|
|
1716
|
+
if (item.href) mi.url = item.href;
|
|
1717
|
+
if (item.icon) mi.icon = item.icon;
|
|
1718
|
+
if (item.children?.length) {
|
|
1719
|
+
mi.children = this._toMenuItems(item.children);
|
|
1720
|
+
}
|
|
1721
|
+
return mi;
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1556
1725
|
render() {
|
|
1726
|
+
if (this._isMobile) {
|
|
1727
|
+
this._renderMobile();
|
|
1728
|
+
} else {
|
|
1729
|
+
this._renderDesktop();
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
_renderMobile() {
|
|
1734
|
+
const size = this.size;
|
|
1735
|
+
|
|
1736
|
+
const sizeConfig = {
|
|
1737
|
+
small: {
|
|
1738
|
+
padding: "var(--spacing-x-small, 4px)",
|
|
1739
|
+
buttonSize: "small",
|
|
1740
|
+
iconSize: "small",
|
|
1741
|
+
},
|
|
1742
|
+
medium: {
|
|
1743
|
+
padding: "var(--spacing-small, 6px)",
|
|
1744
|
+
buttonSize: "medium",
|
|
1745
|
+
iconSize: "medium",
|
|
1746
|
+
},
|
|
1747
|
+
large: {
|
|
1748
|
+
padding: "var(--spacing-medium, 8px)",
|
|
1749
|
+
buttonSize: "large",
|
|
1750
|
+
iconSize: "large",
|
|
1751
|
+
},
|
|
1752
|
+
};
|
|
1753
|
+
|
|
1754
|
+
this.shadowRoot.innerHTML = "";
|
|
1755
|
+
this._idCounter = 0;
|
|
1756
|
+
|
|
1757
|
+
const cfg = sizeConfig[size] || sizeConfig.medium;
|
|
1758
|
+
const style = document.createElement("style");
|
|
1759
|
+
|
|
1760
|
+
style.textContent = `
|
|
1761
|
+
:host {
|
|
1762
|
+
display: block;
|
|
1763
|
+
font-family: var(--font-family-body, sans-serif);
|
|
1764
|
+
color: var(--component-appbar-color, #f7f7fa);
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
:host([sticky]),
|
|
1768
|
+
:host([sticky="start"]),
|
|
1769
|
+
:host([sticky="end"]) {
|
|
1770
|
+
position: sticky;
|
|
1771
|
+
top: 0;
|
|
1772
|
+
left: 0;
|
|
1773
|
+
width: 100%;
|
|
1774
|
+
z-index: var(--component-appbar-z-index, 100);
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
:host([sticky]) .appbar {
|
|
1778
|
+
border-radius: 0;
|
|
1779
|
+
border: none;
|
|
1780
|
+
border-bottom: var(--component-appbar-border-width, var(--component-sidebar-border-width, 2px)) solid var(--component-appbar-border-color, #37383a);
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
.appbar {
|
|
1784
|
+
display: flex;
|
|
1785
|
+
flex-direction: row;
|
|
1786
|
+
align-items: center;
|
|
1787
|
+
background: var(--component-appbar-background, #0c0c0d);
|
|
1788
|
+
border: var(--component-appbar-border-width, var(--component-sidebar-border-width, 2px)) solid var(--component-appbar-border-color, #37383a);
|
|
1789
|
+
border-radius: var(--component-appbar-border-radius, var(--component-sidebar-border-radius, 4px));
|
|
1790
|
+
overflow: visible;
|
|
1791
|
+
padding: var(--_appbar-padding);
|
|
1792
|
+
box-sizing: border-box;
|
|
1793
|
+
width: 100%;
|
|
1794
|
+
height: auto;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
.mobile-start {
|
|
1798
|
+
display: flex;
|
|
1799
|
+
align-items: center;
|
|
1800
|
+
flex-shrink: 0;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
.mobile-center {
|
|
1804
|
+
flex: 1;
|
|
1805
|
+
display: flex;
|
|
1806
|
+
justify-content: center;
|
|
1807
|
+
align-items: center;
|
|
1808
|
+
overflow: hidden;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
.mobile-end {
|
|
1812
|
+
display: flex;
|
|
1813
|
+
align-items: center;
|
|
1814
|
+
flex-shrink: 0;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
.mobile-end ::slotted(*) {
|
|
1818
|
+
display: block;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
::slotted(*) {
|
|
1822
|
+
display: block;
|
|
1823
|
+
}
|
|
1824
|
+
`;
|
|
1825
|
+
this.shadowRoot.appendChild(style);
|
|
1826
|
+
|
|
1827
|
+
const bar = document.createElement("div");
|
|
1828
|
+
bar.className = "appbar";
|
|
1829
|
+
bar.setAttribute("role", "navigation");
|
|
1830
|
+
bar.style.setProperty("--_appbar-padding", cfg.padding);
|
|
1831
|
+
|
|
1832
|
+
/* ── Left: hamburger button ── */
|
|
1833
|
+
const startSection = document.createElement("div");
|
|
1834
|
+
startSection.className = "mobile-start";
|
|
1835
|
+
|
|
1836
|
+
const menuBtn = document.createElement("y-button");
|
|
1837
|
+
const menuBtnId = this._uid("appbar-mobile-menu");
|
|
1838
|
+
menuBtn.id = menuBtnId;
|
|
1839
|
+
menuBtn.setAttribute("color", "base");
|
|
1840
|
+
menuBtn.setAttribute("style-type", "flat");
|
|
1841
|
+
menuBtn.setAttribute("size", cfg.buttonSize);
|
|
1842
|
+
menuBtn.setAttribute("aria-label", "Open menu");
|
|
1843
|
+
|
|
1844
|
+
const menuIcon = document.createElement("span");
|
|
1845
|
+
menuIcon.slot = "left-icon";
|
|
1846
|
+
menuIcon.innerHTML = menu;
|
|
1847
|
+
menuBtn.appendChild(menuIcon);
|
|
1848
|
+
|
|
1849
|
+
startSection.appendChild(menuBtn);
|
|
1850
|
+
|
|
1851
|
+
const navItems = this.items;
|
|
1852
|
+
if (navItems.length > 0) {
|
|
1853
|
+
const mobileMenu = document.createElement("y-menu");
|
|
1854
|
+
mobileMenu.setAttribute("anchor", menuBtnId);
|
|
1855
|
+
mobileMenu.setAttribute("direction", "down");
|
|
1856
|
+
mobileMenu.setAttribute("size", cfg.buttonSize);
|
|
1857
|
+
mobileMenu.items = this._toMenuItems(navItems);
|
|
1858
|
+
startSection.appendChild(mobileMenu);
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
bar.appendChild(startSection);
|
|
1862
|
+
|
|
1863
|
+
/* ── Center: logo + title ── */
|
|
1864
|
+
const centerSection = document.createElement("div");
|
|
1865
|
+
centerSection.className = "mobile-center";
|
|
1866
|
+
|
|
1867
|
+
const logoSlot = document.createElement("slot");
|
|
1868
|
+
logoSlot.name = "logo";
|
|
1869
|
+
centerSection.appendChild(logoSlot);
|
|
1870
|
+
|
|
1871
|
+
const titleSlot = document.createElement("slot");
|
|
1872
|
+
titleSlot.name = "title";
|
|
1873
|
+
centerSection.appendChild(titleSlot);
|
|
1874
|
+
|
|
1875
|
+
bar.appendChild(centerSection);
|
|
1876
|
+
|
|
1877
|
+
/* ── Right: footer slot ── */
|
|
1878
|
+
const endSection = document.createElement("div");
|
|
1879
|
+
endSection.className = "mobile-end";
|
|
1880
|
+
endSection.setAttribute("part", "footer");
|
|
1881
|
+
|
|
1882
|
+
const footerSlot = document.createElement("slot");
|
|
1883
|
+
footerSlot.name = "footer";
|
|
1884
|
+
endSection.appendChild(footerSlot);
|
|
1885
|
+
|
|
1886
|
+
bar.appendChild(endSection);
|
|
1887
|
+
this.shadowRoot.appendChild(bar);
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
_renderDesktop() {
|
|
1557
1891
|
const isVertical = this.orientation === "vertical";
|
|
1558
1892
|
const isCollapsed = this.collapsed && isVertical;
|
|
1559
1893
|
const size = this.size;
|
|
@@ -1582,12 +1916,13 @@ class YumeAppbar extends HTMLElement {
|
|
|
1582
1916
|
iconSize: "large",
|
|
1583
1917
|
},
|
|
1584
1918
|
};
|
|
1585
|
-
const cfg = sizeConfig[size] || sizeConfig.medium;
|
|
1586
1919
|
|
|
1587
1920
|
this.shadowRoot.innerHTML = "";
|
|
1588
1921
|
this._idCounter = 0;
|
|
1589
1922
|
|
|
1923
|
+
const cfg = sizeConfig[size] || sizeConfig.medium;
|
|
1590
1924
|
const style = document.createElement("style");
|
|
1925
|
+
|
|
1591
1926
|
style.textContent = `
|
|
1592
1927
|
:host {
|
|
1593
1928
|
display: block;
|
|
@@ -1816,15 +2151,11 @@ class YumeAppbar extends HTMLElement {
|
|
|
1816
2151
|
`;
|
|
1817
2152
|
this.shadowRoot.appendChild(style);
|
|
1818
2153
|
|
|
1819
|
-
// Clone document stylesheets so CSS-class-based icons (e.g. Font Awesome) render in shadow DOM
|
|
1820
|
-
document.querySelectorAll('link[rel="stylesheet"]').forEach((link) => {
|
|
1821
|
-
this.shadowRoot.appendChild(link.cloneNode(true));
|
|
1822
|
-
});
|
|
1823
|
-
|
|
1824
2154
|
const bar = document.createElement("div");
|
|
1825
2155
|
bar.className = `appbar ${isVertical ? "vertical" : "horizontal"}`;
|
|
1826
2156
|
|
|
1827
2157
|
if (isCollapsed) bar.classList.add("collapsed");
|
|
2158
|
+
|
|
1828
2159
|
bar.setAttribute("role", "navigation");
|
|
1829
2160
|
bar.style.setProperty("--_appbar-padding", cfg.padding);
|
|
1830
2161
|
bar.style.setProperty("--_appbar-collapsed-width", cfg.collapsedWidth);
|
|
@@ -1834,7 +2165,6 @@ class YumeAppbar extends HTMLElement {
|
|
|
1834
2165
|
`calc(${cfg.collapsedWidth} - 2 * var(--_appbar-padding) - 2 * var(--component-appbar-border-width, var(--component-sidebar-border-width, 2px)))`,
|
|
1835
2166
|
);
|
|
1836
2167
|
|
|
1837
|
-
/* --- Header: logo + title --- */
|
|
1838
2168
|
const header = document.createElement("div");
|
|
1839
2169
|
header.className = "appbar-header";
|
|
1840
2170
|
header.setAttribute("part", "header");
|
|
@@ -1864,21 +2194,22 @@ class YumeAppbar extends HTMLElement {
|
|
|
1864
2194
|
header.appendChild(headerSlot);
|
|
1865
2195
|
bar.appendChild(header);
|
|
1866
2196
|
|
|
1867
|
-
/* --- Body: y-button nav items --- */
|
|
1868
2197
|
const body = document.createElement("div");
|
|
1869
2198
|
body.className = "appbar-body";
|
|
1870
2199
|
body.setAttribute("part", "body");
|
|
1871
2200
|
|
|
1872
2201
|
const navItems = this.items;
|
|
2202
|
+
|
|
1873
2203
|
navItems.forEach((item) => {
|
|
1874
2204
|
const hasChildren = item.children?.length > 0;
|
|
1875
2205
|
const wrapper = document.createElement("div");
|
|
1876
|
-
wrapper.className = "nav-item";
|
|
1877
|
-
|
|
1878
2206
|
const btn = document.createElement("y-button");
|
|
1879
2207
|
const btnId = this._uid("appbar-btn");
|
|
1880
|
-
btn.id = btnId;
|
|
1881
2208
|
const isActive = this._isItemActive(item);
|
|
2209
|
+
|
|
2210
|
+
wrapper.className = "nav-item";
|
|
2211
|
+
btn.id = btnId;
|
|
2212
|
+
|
|
1882
2213
|
btn.setAttribute("color", isActive ? "primary" : "base");
|
|
1883
2214
|
btn.setAttribute("style-type", "flat");
|
|
1884
2215
|
btn.setAttribute("size", cfg.buttonSize);
|
|
@@ -1941,7 +2272,6 @@ class YumeAppbar extends HTMLElement {
|
|
|
1941
2272
|
|
|
1942
2273
|
bar.appendChild(body);
|
|
1943
2274
|
|
|
1944
|
-
/* --- Footer: slot + collapse toggle (vertical only) --- */
|
|
1945
2275
|
const footer = document.createElement("div");
|
|
1946
2276
|
footer.className = "appbar-footer";
|
|
1947
2277
|
footer.setAttribute("part", "footer");
|
|
@@ -2159,22 +2489,27 @@ class YumeBadge extends HTMLElement {
|
|
|
2159
2489
|
}
|
|
2160
2490
|
}
|
|
2161
2491
|
|
|
2492
|
+
/** Horizontal alignment of the badge: "left" | "right" (default "right"). */
|
|
2162
2493
|
get alignment() {
|
|
2163
2494
|
return this.getAttribute("alignment") || "right";
|
|
2164
2495
|
}
|
|
2165
2496
|
|
|
2497
|
+
/** Color theme: "primary" | "secondary" | "base" | "success" | "warning" | "error" | "help". */
|
|
2166
2498
|
get color() {
|
|
2167
2499
|
return this.getAttribute("color") || "primary";
|
|
2168
2500
|
}
|
|
2169
2501
|
|
|
2502
|
+
/** Vertical position of the badge: "top" | "bottom" (default "top"). */
|
|
2170
2503
|
get position() {
|
|
2171
2504
|
return this.getAttribute("position") || "top";
|
|
2172
2505
|
}
|
|
2173
2506
|
|
|
2507
|
+
/** Badge size: "small" | "medium" | "large" (default "small"). */
|
|
2174
2508
|
get size() {
|
|
2175
2509
|
return this.getAttribute("size") || "small";
|
|
2176
2510
|
}
|
|
2177
2511
|
|
|
2512
|
+
/** The text content displayed inside the badge. */
|
|
2178
2513
|
get value() {
|
|
2179
2514
|
return this.getAttribute("value") || "";
|
|
2180
2515
|
}
|
|
@@ -2485,6 +2820,7 @@ class YumeCheckbox extends HTMLElement {
|
|
|
2485
2820
|
this.updateState();
|
|
2486
2821
|
}
|
|
2487
2822
|
|
|
2823
|
+
/** @type {boolean} Whether the checkbox is checked. */
|
|
2488
2824
|
get checked() {
|
|
2489
2825
|
return this.hasAttribute("checked");
|
|
2490
2826
|
}
|
|
@@ -2494,6 +2830,7 @@ class YumeCheckbox extends HTMLElement {
|
|
|
2494
2830
|
else this.removeAttribute("checked");
|
|
2495
2831
|
}
|
|
2496
2832
|
|
|
2833
|
+
/** @type {boolean} Whether the checkbox is disabled. */
|
|
2497
2834
|
get disabled() {
|
|
2498
2835
|
return this.hasAttribute("disabled");
|
|
2499
2836
|
}
|
|
@@ -2503,6 +2840,7 @@ class YumeCheckbox extends HTMLElement {
|
|
|
2503
2840
|
else this.removeAttribute("disabled");
|
|
2504
2841
|
}
|
|
2505
2842
|
|
|
2843
|
+
/** @type {boolean} Whether the checkbox is in an indeterminate state. */
|
|
2506
2844
|
get indeterminate() {
|
|
2507
2845
|
return this.hasAttribute("indeterminate");
|
|
2508
2846
|
}
|
|
@@ -2512,6 +2850,7 @@ class YumeCheckbox extends HTMLElement {
|
|
|
2512
2850
|
else this.removeAttribute("indeterminate");
|
|
2513
2851
|
}
|
|
2514
2852
|
|
|
2853
|
+
/** @type {string} The form value submitted when checked. Defaults to "on". */
|
|
2515
2854
|
get value() {
|
|
2516
2855
|
return this.getAttribute("value") || "on";
|
|
2517
2856
|
}
|
|
@@ -2520,10 +2859,12 @@ class YumeCheckbox extends HTMLElement {
|
|
|
2520
2859
|
this.setAttribute("value", val);
|
|
2521
2860
|
}
|
|
2522
2861
|
|
|
2862
|
+
/** @type {string|null} The form name of the checkbox. */
|
|
2523
2863
|
get name() {
|
|
2524
2864
|
return this.getAttribute("name");
|
|
2525
2865
|
}
|
|
2526
2866
|
|
|
2867
|
+
/** Toggles the checked state and dispatches a "change" event. */
|
|
2527
2868
|
toggle() {
|
|
2528
2869
|
if (this.disabled) return;
|
|
2529
2870
|
if (this.indeterminate) {
|
|
@@ -2681,7 +3022,7 @@ if (!customElements.get("y-checkbox")) {
|
|
|
2681
3022
|
|
|
2682
3023
|
class YumeDialog extends HTMLElement {
|
|
2683
3024
|
static get observedAttributes() {
|
|
2684
|
-
return ["visible", "anchor", "closable"];
|
|
3025
|
+
return ["visible", "anchor", "closable", "show-backdrop", "animate"];
|
|
2685
3026
|
}
|
|
2686
3027
|
|
|
2687
3028
|
constructor() {
|
|
@@ -2710,6 +3051,7 @@ class YumeDialog extends HTMLElement {
|
|
|
2710
3051
|
}
|
|
2711
3052
|
}
|
|
2712
3053
|
|
|
3054
|
+
/** Whether the dialog is currently displayed. */
|
|
2713
3055
|
get visible() {
|
|
2714
3056
|
return this.hasAttribute("visible");
|
|
2715
3057
|
}
|
|
@@ -2719,6 +3061,7 @@ class YumeDialog extends HTMLElement {
|
|
|
2719
3061
|
else this.removeAttribute("visible");
|
|
2720
3062
|
}
|
|
2721
3063
|
|
|
3064
|
+
/** The id of the element that toggles this dialog on click. */
|
|
2722
3065
|
get anchor() {
|
|
2723
3066
|
return this.getAttribute("anchor");
|
|
2724
3067
|
}
|
|
@@ -2727,6 +3070,7 @@ class YumeDialog extends HTMLElement {
|
|
|
2727
3070
|
this.setAttribute("anchor", id);
|
|
2728
3071
|
}
|
|
2729
3072
|
|
|
3073
|
+
/** Whether the dialog renders a close button in the header. */
|
|
2730
3074
|
get closable() {
|
|
2731
3075
|
return this.hasAttribute("closable");
|
|
2732
3076
|
}
|
|
@@ -2735,6 +3079,25 @@ class YumeDialog extends HTMLElement {
|
|
|
2735
3079
|
else this.removeAttribute("closable");
|
|
2736
3080
|
}
|
|
2737
3081
|
|
|
3082
|
+
/** Whether to apply a blurred backdrop behind the dialog. */
|
|
3083
|
+
get showBackdrop() {
|
|
3084
|
+
return this.hasAttribute("show-backdrop");
|
|
3085
|
+
}
|
|
3086
|
+
set showBackdrop(val) {
|
|
3087
|
+
if (val) this.setAttribute("show-backdrop", "");
|
|
3088
|
+
else this.removeAttribute("show-backdrop");
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
/** Whether the dialog uses an entrance animation. */
|
|
3092
|
+
get animate() {
|
|
3093
|
+
return this.hasAttribute("animate");
|
|
3094
|
+
}
|
|
3095
|
+
set animate(val) {
|
|
3096
|
+
if (val) this.setAttribute("animate", "");
|
|
3097
|
+
else this.removeAttribute("animate");
|
|
3098
|
+
}
|
|
3099
|
+
|
|
3100
|
+
/** Opens the dialog and focuses it. */
|
|
2738
3101
|
show() {
|
|
2739
3102
|
if (!this.shadowRoot.querySelector(".dialog")) {
|
|
2740
3103
|
this.render();
|
|
@@ -2748,6 +3111,7 @@ class YumeDialog extends HTMLElement {
|
|
|
2748
3111
|
}
|
|
2749
3112
|
}
|
|
2750
3113
|
|
|
3114
|
+
/** Closes the dialog. */
|
|
2751
3115
|
hide() {
|
|
2752
3116
|
document.removeEventListener("keydown", this.onKeyDown);
|
|
2753
3117
|
}
|
|
@@ -2788,6 +3152,16 @@ class YumeDialog extends HTMLElement {
|
|
|
2788
3152
|
z-index: var(--component-dialog-z-index, 1000);
|
|
2789
3153
|
}
|
|
2790
3154
|
:host([visible]) { display: flex; }
|
|
3155
|
+
:host([show-backdrop]) {
|
|
3156
|
+
backdrop-filter: blur(var(--component-dialog-backdrop-blur, 4px));
|
|
3157
|
+
-webkit-backdrop-filter: blur(var(--component-dialog-backdrop-blur, 4px));
|
|
3158
|
+
}
|
|
3159
|
+
|
|
3160
|
+
@keyframes dialog-fade-in {
|
|
3161
|
+
from { opacity: 0; transform: translateY(16px) scale(0.97); }
|
|
3162
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
3163
|
+
}
|
|
3164
|
+
|
|
2791
3165
|
.dialog {
|
|
2792
3166
|
background: var(--component-dialog-background);
|
|
2793
3167
|
border: var(--component-dialog-border-width, 1px) solid var(--component-dialog-border-color);
|
|
@@ -2798,6 +3172,9 @@ class YumeDialog extends HTMLElement {
|
|
|
2798
3172
|
flex-direction: column;
|
|
2799
3173
|
box-shadow: var(--component-dialog-shadow, 0 2px 10px rgba(0,0,0,0.3));
|
|
2800
3174
|
}
|
|
3175
|
+
:host([animate][visible]) .dialog {
|
|
3176
|
+
animation: dialog-fade-in var(--component-dialog-animation-duration, 0.2s) ease-out both;
|
|
3177
|
+
}
|
|
2801
3178
|
.header {
|
|
2802
3179
|
padding: var(--component-dialog-padding, var(--spacing-medium));
|
|
2803
3180
|
font-weight: bold;
|
|
@@ -2810,26 +3187,6 @@ class YumeDialog extends HTMLElement {
|
|
|
2810
3187
|
.header-content {
|
|
2811
3188
|
flex: 1;
|
|
2812
3189
|
}
|
|
2813
|
-
.close-btn {
|
|
2814
|
-
background: none;
|
|
2815
|
-
border: none;
|
|
2816
|
-
cursor: pointer;
|
|
2817
|
-
padding: var(--spacing-x-small, 4px);
|
|
2818
|
-
color: var(--component-dialog-color, #f7f7fa);
|
|
2819
|
-
font-size: 1.25em;
|
|
2820
|
-
line-height: 1;
|
|
2821
|
-
border-radius: var(--component-button-border-radius-outer, 4px);
|
|
2822
|
-
display: flex;
|
|
2823
|
-
align-items: center;
|
|
2824
|
-
justify-content: center;
|
|
2825
|
-
}
|
|
2826
|
-
.close-btn:hover {
|
|
2827
|
-
background: var(--component-dialog-hover-background, #292a2b);
|
|
2828
|
-
}
|
|
2829
|
-
.close-btn:focus-visible {
|
|
2830
|
-
outline: 2px solid var(--component-dialog-accent);
|
|
2831
|
-
outline-offset: -1px;
|
|
2832
|
-
}
|
|
2833
3190
|
.body {
|
|
2834
3191
|
padding: var(--component-dialog-padding, var(--spacing-medium));
|
|
2835
3192
|
overflow: auto;
|
|
@@ -2865,10 +3222,11 @@ class YumeDialog extends HTMLElement {
|
|
|
2865
3222
|
header.appendChild(headerContent);
|
|
2866
3223
|
|
|
2867
3224
|
if (this.closable) {
|
|
2868
|
-
const closeBtn = document.createElement("button");
|
|
2869
|
-
closeBtn.
|
|
3225
|
+
const closeBtn = document.createElement("y-button");
|
|
3226
|
+
closeBtn.setAttribute("size", "small");
|
|
3227
|
+
closeBtn.setAttribute("style-type", "flat");
|
|
2870
3228
|
closeBtn.setAttribute("aria-label", "Close");
|
|
2871
|
-
closeBtn.
|
|
3229
|
+
closeBtn.textContent = "\u2715";
|
|
2872
3230
|
closeBtn.addEventListener("click", () => {
|
|
2873
3231
|
this.visible = false;
|
|
2874
3232
|
});
|
|
@@ -2890,18 +3248,20 @@ class YumeDialog extends HTMLElement {
|
|
|
2890
3248
|
dialog.appendChild(footer);
|
|
2891
3249
|
this.shadowRoot.appendChild(dialog);
|
|
2892
3250
|
|
|
2893
|
-
// Hide slot containers that have no slotted content
|
|
2894
3251
|
const hideIfEmpty = (wrapper) => {
|
|
2895
3252
|
const slot = wrapper.querySelector("slot");
|
|
2896
3253
|
if (!slot) return;
|
|
3254
|
+
|
|
2897
3255
|
const update = () => {
|
|
2898
3256
|
const hasContent =
|
|
2899
3257
|
slot.assignedNodes({ flatten: true }).length > 0;
|
|
2900
3258
|
wrapper.style.display = hasContent ? "" : "none";
|
|
2901
3259
|
};
|
|
3260
|
+
|
|
2902
3261
|
slot.addEventListener("slotchange", update);
|
|
2903
3262
|
update();
|
|
2904
3263
|
};
|
|
3264
|
+
|
|
2905
3265
|
if (!this.closable) hideIfEmpty(header);
|
|
2906
3266
|
hideIfEmpty(body);
|
|
2907
3267
|
hideIfEmpty(footer);
|
|
@@ -3014,8 +3374,7 @@ class YumeDrawer extends HTMLElement {
|
|
|
3014
3374
|
|
|
3015
3375
|
_show() {
|
|
3016
3376
|
this.style.display = "block";
|
|
3017
|
-
|
|
3018
|
-
this.offsetHeight; // eslint-disable-line no-unused-expressions
|
|
3377
|
+
this.offsetHeight;
|
|
3019
3378
|
|
|
3020
3379
|
const overlay = this.shadowRoot.querySelector(".overlay");
|
|
3021
3380
|
const panel = this.shadowRoot.querySelector(".drawer-panel");
|
|
@@ -3401,6 +3760,7 @@ class YumeInput extends HTMLElement {
|
|
|
3401
3760
|
this.render();
|
|
3402
3761
|
}
|
|
3403
3762
|
|
|
3763
|
+
/** @type {string} The current input value. */
|
|
3404
3764
|
get value() {
|
|
3405
3765
|
return this.input?.value || "";
|
|
3406
3766
|
}
|
|
@@ -3411,6 +3771,10 @@ class YumeInput extends HTMLElement {
|
|
|
3411
3771
|
this._internals.setFormValue(val, this.getAttribute("name"));
|
|
3412
3772
|
}
|
|
3413
3773
|
|
|
3774
|
+
/**
|
|
3775
|
+
* Checks the validity of the underlying input element.
|
|
3776
|
+
* @returns {boolean} Whether the input is valid.
|
|
3777
|
+
*/
|
|
3414
3778
|
checkValidity() {
|
|
3415
3779
|
return this.input?.checkValidity?.() ?? true;
|
|
3416
3780
|
}
|
|
@@ -3446,6 +3810,7 @@ class YumeInput extends HTMLElement {
|
|
|
3446
3810
|
}[size] || "var(--sizing-medium, 40px)";
|
|
3447
3811
|
|
|
3448
3812
|
const sheet = new CSSStyleSheet();
|
|
3813
|
+
|
|
3449
3814
|
sheet.replaceSync(`
|
|
3450
3815
|
:host {
|
|
3451
3816
|
display: block;
|
|
@@ -3582,8 +3947,10 @@ class YumePanel extends HTMLElement {
|
|
|
3582
3947
|
constructor() {
|
|
3583
3948
|
super();
|
|
3584
3949
|
this.attachShadow({ mode: "open" });
|
|
3950
|
+
|
|
3585
3951
|
this._expanded = false;
|
|
3586
3952
|
this._checkRouteMatchBound = this.checkRouteMatch.bind(this);
|
|
3953
|
+
|
|
3587
3954
|
this.render();
|
|
3588
3955
|
}
|
|
3589
3956
|
|
|
@@ -3622,6 +3989,7 @@ class YumePanel extends HTMLElement {
|
|
|
3622
3989
|
}
|
|
3623
3990
|
}
|
|
3624
3991
|
|
|
3992
|
+
/** @type {boolean} Whether the panel is in a selected/active state. */
|
|
3625
3993
|
get selected() {
|
|
3626
3994
|
return this.hasAttribute("selected");
|
|
3627
3995
|
}
|
|
@@ -3631,6 +3999,7 @@ class YumePanel extends HTMLElement {
|
|
|
3631
3999
|
else this.removeAttribute("selected");
|
|
3632
4000
|
}
|
|
3633
4001
|
|
|
4002
|
+
/** @type {boolean} Whether the panel's children slot is visible. */
|
|
3634
4003
|
get expanded() {
|
|
3635
4004
|
return this.hasAttribute("expanded");
|
|
3636
4005
|
}
|
|
@@ -3640,8 +4009,10 @@ class YumePanel extends HTMLElement {
|
|
|
3640
4009
|
else this.removeAttribute("expanded");
|
|
3641
4010
|
}
|
|
3642
4011
|
|
|
4012
|
+
/** Toggles the expanded state (collapses siblings when inside an exclusive panelbar). */
|
|
3643
4013
|
toggle() {
|
|
3644
4014
|
if (!this.hasChildren()) return;
|
|
4015
|
+
|
|
3645
4016
|
if (!this._expanded) {
|
|
3646
4017
|
const parentBar = this.closest("y-panelbar");
|
|
3647
4018
|
if (parentBar && parentBar.hasAttribute("exclusive")) {
|
|
@@ -3661,6 +4032,7 @@ class YumePanel extends HTMLElement {
|
|
|
3661
4032
|
} else {
|
|
3662
4033
|
this.collapse();
|
|
3663
4034
|
}
|
|
4035
|
+
|
|
3664
4036
|
this.dispatchEvent(
|
|
3665
4037
|
new CustomEvent("toggle", {
|
|
3666
4038
|
detail: { expanded: this._expanded },
|
|
@@ -3670,6 +4042,7 @@ class YumePanel extends HTMLElement {
|
|
|
3670
4042
|
);
|
|
3671
4043
|
}
|
|
3672
4044
|
|
|
4045
|
+
/** Expands the panel to show its children. */
|
|
3673
4046
|
expand() {
|
|
3674
4047
|
if (!this.hasChildren()) return;
|
|
3675
4048
|
this.expanded = true;
|
|
@@ -3684,6 +4057,7 @@ class YumePanel extends HTMLElement {
|
|
|
3684
4057
|
);
|
|
3685
4058
|
}
|
|
3686
4059
|
|
|
4060
|
+
/** Collapses the panel to hide its children. */
|
|
3687
4061
|
collapse() {
|
|
3688
4062
|
this.expanded = false;
|
|
3689
4063
|
this._expanded = false;
|
|
@@ -3713,6 +4087,7 @@ class YumePanel extends HTMLElement {
|
|
|
3713
4087
|
break;
|
|
3714
4088
|
}
|
|
3715
4089
|
}
|
|
4090
|
+
|
|
3716
4091
|
this.setAttribute("data-is-child", depth > 0 ? "true" : "false");
|
|
3717
4092
|
this.style.setProperty("--panel-depth", depth);
|
|
3718
4093
|
}
|
|
@@ -3768,6 +4143,7 @@ class YumePanel extends HTMLElement {
|
|
|
3768
4143
|
const childrenSlot = this.shadowRoot.querySelector(
|
|
3769
4144
|
'slot[name="children"]',
|
|
3770
4145
|
);
|
|
4146
|
+
|
|
3771
4147
|
if (childrenSlot) {
|
|
3772
4148
|
childrenSlot.addEventListener("slotchange", () =>
|
|
3773
4149
|
this.checkForChildren(),
|
|
@@ -3775,11 +4151,17 @@ class YumePanel extends HTMLElement {
|
|
|
3775
4151
|
}
|
|
3776
4152
|
}
|
|
3777
4153
|
|
|
4154
|
+
/**
|
|
4155
|
+
* Checks whether the panel has slotted children content.
|
|
4156
|
+
* @returns {boolean}
|
|
4157
|
+
*/
|
|
3778
4158
|
hasChildren() {
|
|
3779
4159
|
const childrenSlot = this.shadowRoot.querySelector(
|
|
3780
4160
|
'slot[name="children"]',
|
|
3781
4161
|
);
|
|
4162
|
+
|
|
3782
4163
|
if (!childrenSlot) return false;
|
|
4164
|
+
|
|
3783
4165
|
const nodes = childrenSlot.assignedNodes({ flatten: true });
|
|
3784
4166
|
return nodes.some((n) => {
|
|
3785
4167
|
if (n.nodeType === Node.TEXT_NODE) {
|
|
@@ -3791,7 +4173,9 @@ class YumePanel extends HTMLElement {
|
|
|
3791
4173
|
|
|
3792
4174
|
checkForChildren() {
|
|
3793
4175
|
const hasChildren = this.hasChildren();
|
|
4176
|
+
|
|
3794
4177
|
this.setAttribute("data-has-children", hasChildren ? "true" : "false");
|
|
4178
|
+
|
|
3795
4179
|
if (!hasChildren && this.expanded) {
|
|
3796
4180
|
this.expanded = false;
|
|
3797
4181
|
}
|
|
@@ -3801,6 +4185,7 @@ class YumePanel extends HTMLElement {
|
|
|
3801
4185
|
const hasChildren = this.hasChildren();
|
|
3802
4186
|
const header = this.shadowRoot.querySelector(".header");
|
|
3803
4187
|
const isExpanded = this.expanded && hasChildren;
|
|
4188
|
+
|
|
3804
4189
|
this._expanded = isExpanded;
|
|
3805
4190
|
|
|
3806
4191
|
if (header) {
|
|
@@ -3810,6 +4195,7 @@ class YumePanel extends HTMLElement {
|
|
|
3810
4195
|
|
|
3811
4196
|
render() {
|
|
3812
4197
|
const sheet = new CSSStyleSheet();
|
|
4198
|
+
|
|
3813
4199
|
sheet.replaceSync(`
|
|
3814
4200
|
:host {
|
|
3815
4201
|
display: block;
|
|
@@ -3987,6 +4373,7 @@ class YumeProgress extends HTMLElement {
|
|
|
3987
4373
|
}
|
|
3988
4374
|
}
|
|
3989
4375
|
|
|
4376
|
+
/** Current progress value, or null if unset. */
|
|
3990
4377
|
get value() {
|
|
3991
4378
|
const val = parseFloat(this.getAttribute("value"));
|
|
3992
4379
|
return Number.isNaN(val) ? null : val;
|
|
@@ -4000,6 +4387,7 @@ class YumeProgress extends HTMLElement {
|
|
|
4000
4387
|
}
|
|
4001
4388
|
}
|
|
4002
4389
|
|
|
4390
|
+
/** Minimum value (default 0). */
|
|
4003
4391
|
get min() {
|
|
4004
4392
|
return parseFloat(this.getAttribute("min")) || 0;
|
|
4005
4393
|
}
|
|
@@ -4008,6 +4396,7 @@ class YumeProgress extends HTMLElement {
|
|
|
4008
4396
|
this.setAttribute("min", String(val));
|
|
4009
4397
|
}
|
|
4010
4398
|
|
|
4399
|
+
/** Maximum value (default 100). */
|
|
4011
4400
|
get max() {
|
|
4012
4401
|
return parseFloat(this.getAttribute("max")) || 100;
|
|
4013
4402
|
}
|
|
@@ -4016,6 +4405,7 @@ class YumeProgress extends HTMLElement {
|
|
|
4016
4405
|
this.setAttribute("max", String(val));
|
|
4017
4406
|
}
|
|
4018
4407
|
|
|
4408
|
+
/** Step increment for snapping, or null if continuous. */
|
|
4019
4409
|
get step() {
|
|
4020
4410
|
const s = parseFloat(this.getAttribute("step"));
|
|
4021
4411
|
return Number.isNaN(s) || s <= 0 ? null : s;
|
|
@@ -4029,6 +4419,7 @@ class YumeProgress extends HTMLElement {
|
|
|
4029
4419
|
}
|
|
4030
4420
|
}
|
|
4031
4421
|
|
|
4422
|
+
/** Bar thickness: "small" | "medium" | "large" (default "medium"). */
|
|
4032
4423
|
get size() {
|
|
4033
4424
|
return this.getAttribute("size") || "medium";
|
|
4034
4425
|
}
|
|
@@ -4037,6 +4428,7 @@ class YumeProgress extends HTMLElement {
|
|
|
4037
4428
|
this.setAttribute("size", val);
|
|
4038
4429
|
}
|
|
4039
4430
|
|
|
4431
|
+
/** Color theme for the progress bar (default "primary"). */
|
|
4040
4432
|
get color() {
|
|
4041
4433
|
return this.getAttribute("color") || "primary";
|
|
4042
4434
|
}
|
|
@@ -4045,6 +4437,7 @@ class YumeProgress extends HTMLElement {
|
|
|
4045
4437
|
this.setAttribute("color", val);
|
|
4046
4438
|
}
|
|
4047
4439
|
|
|
4440
|
+
/** Whether to show the value label on the bar (default true). */
|
|
4048
4441
|
get labelDisplay() {
|
|
4049
4442
|
return this.getAttribute("label-display") !== "false";
|
|
4050
4443
|
}
|
|
@@ -4053,6 +4446,7 @@ class YumeProgress extends HTMLElement {
|
|
|
4053
4446
|
this.setAttribute("label-display", val ? "true" : "false");
|
|
4054
4447
|
}
|
|
4055
4448
|
|
|
4449
|
+
/** Label format: "percent" | "value" | "fraction" (default "percent"). */
|
|
4056
4450
|
get labelFormat() {
|
|
4057
4451
|
return this.getAttribute("label-format") || "percent";
|
|
4058
4452
|
}
|
|
@@ -4061,6 +4455,7 @@ class YumeProgress extends HTMLElement {
|
|
|
4061
4455
|
this.setAttribute("label-format", val);
|
|
4062
4456
|
}
|
|
4063
4457
|
|
|
4458
|
+
/** Whether the progress bar shows an indeterminate animation. */
|
|
4064
4459
|
get indeterminate() {
|
|
4065
4460
|
return this.hasAttribute("indeterminate");
|
|
4066
4461
|
}
|
|
@@ -4070,6 +4465,7 @@ class YumeProgress extends HTMLElement {
|
|
|
4070
4465
|
else this.removeAttribute("indeterminate");
|
|
4071
4466
|
}
|
|
4072
4467
|
|
|
4468
|
+
/** Whether the progress bar is disabled. */
|
|
4073
4469
|
get disabled() {
|
|
4074
4470
|
return this.hasAttribute("disabled");
|
|
4075
4471
|
}
|
|
@@ -4097,6 +4493,7 @@ class YumeProgress extends HTMLElement {
|
|
|
4097
4493
|
this.value = Math.max(this.value - s, this.min);
|
|
4098
4494
|
}
|
|
4099
4495
|
|
|
4496
|
+
/** Computed fill percentage (0–100), accounting for min, max, and step. */
|
|
4100
4497
|
get percentage() {
|
|
4101
4498
|
if (this.value === null) return 0;
|
|
4102
4499
|
const range = this.max - this.min;
|
|
@@ -4256,7 +4653,9 @@ class YumeProgress extends HTMLElement {
|
|
|
4256
4653
|
_autoHideHeader() {
|
|
4257
4654
|
const header = this.shadowRoot.querySelector(".progress-header");
|
|
4258
4655
|
const slot = header?.querySelector("slot");
|
|
4656
|
+
|
|
4259
4657
|
if (!slot || !header) return;
|
|
4658
|
+
|
|
4260
4659
|
const update = () => {
|
|
4261
4660
|
const hasContent = slot
|
|
4262
4661
|
.assignedNodes({ flatten: true })
|
|
@@ -4269,6 +4668,7 @@ class YumeProgress extends HTMLElement {
|
|
|
4269
4668
|
);
|
|
4270
4669
|
header.style.display = hasContent ? "" : "none";
|
|
4271
4670
|
};
|
|
4671
|
+
|
|
4272
4672
|
slot.addEventListener("slotchange", update);
|
|
4273
4673
|
update();
|
|
4274
4674
|
}
|
|
@@ -4308,6 +4708,7 @@ class YumeRadio extends HTMLElement {
|
|
|
4308
4708
|
}
|
|
4309
4709
|
}
|
|
4310
4710
|
|
|
4711
|
+
/** @type {string} The currently selected radio value. */
|
|
4311
4712
|
get value() {
|
|
4312
4713
|
return this._value;
|
|
4313
4714
|
}
|
|
@@ -4319,10 +4720,12 @@ class YumeRadio extends HTMLElement {
|
|
|
4319
4720
|
this.updateChecked();
|
|
4320
4721
|
}
|
|
4321
4722
|
|
|
4723
|
+
/** @type {string} The form name of the radio group. */
|
|
4322
4724
|
get name() {
|
|
4323
4725
|
return this.getAttribute("name") || "";
|
|
4324
4726
|
}
|
|
4325
4727
|
|
|
4728
|
+
/** @type {Array<{value: string, label: string}>} The radio options parsed from the "options" attribute. */
|
|
4326
4729
|
get options() {
|
|
4327
4730
|
try {
|
|
4328
4731
|
return JSON.parse(this.getAttribute("options") || "[]");
|
|
@@ -4511,6 +4914,7 @@ class YumeSelect extends HTMLElement {
|
|
|
4511
4914
|
if (!this.hasAttribute("label-position")) {
|
|
4512
4915
|
this.setAttribute("label-position", "top");
|
|
4513
4916
|
}
|
|
4917
|
+
|
|
4514
4918
|
this.updateValidation();
|
|
4515
4919
|
this._internals.setFormValue(this.value);
|
|
4516
4920
|
}
|
|
@@ -4521,7 +4925,9 @@ class YumeSelect extends HTMLElement {
|
|
|
4521
4925
|
|
|
4522
4926
|
_onDocumentClick(e) {
|
|
4523
4927
|
if (this.getAttribute("close-on-click-outside") === "false") return;
|
|
4928
|
+
|
|
4524
4929
|
const path = e.composedPath();
|
|
4930
|
+
|
|
4525
4931
|
if (!path.includes(this) && this.dropdown?.classList.contains("open")) {
|
|
4526
4932
|
this.closeDropdown();
|
|
4527
4933
|
}
|
|
@@ -4555,6 +4961,7 @@ class YumeSelect extends HTMLElement {
|
|
|
4555
4961
|
}
|
|
4556
4962
|
}
|
|
4557
4963
|
|
|
4964
|
+
/** @type {string} The current selected value, or comma-separated values when multiple. */
|
|
4558
4965
|
get value() {
|
|
4559
4966
|
if (this.hasAttribute("multiple")) {
|
|
4560
4967
|
return Array.from(this.selectedValues).join(",");
|
|
@@ -4581,6 +4988,10 @@ class YumeSelect extends HTMLElement {
|
|
|
4581
4988
|
this.updateSelectedStyles();
|
|
4582
4989
|
}
|
|
4583
4990
|
|
|
4991
|
+
/**
|
|
4992
|
+
* Returns the parsed options array from the "options" attribute.
|
|
4993
|
+
* @returns {Array<{value: string, label: string}>}
|
|
4994
|
+
*/
|
|
4584
4995
|
getOptions() {
|
|
4585
4996
|
try {
|
|
4586
4997
|
return JSON.parse(this.getAttribute("options") || "[]");
|
|
@@ -4589,6 +5000,10 @@ class YumeSelect extends HTMLElement {
|
|
|
4589
5000
|
}
|
|
4590
5001
|
}
|
|
4591
5002
|
|
|
5003
|
+
/**
|
|
5004
|
+
* Returns the display text for the current selection.
|
|
5005
|
+
* @returns {string}
|
|
5006
|
+
*/
|
|
4592
5007
|
getDisplayText() {
|
|
4593
5008
|
const options = this.getOptions();
|
|
4594
5009
|
const isMulti = this.hasAttribute("multiple");
|
|
@@ -4615,6 +5030,7 @@ class YumeSelect extends HTMLElement {
|
|
|
4615
5030
|
}
|
|
4616
5031
|
}
|
|
4617
5032
|
|
|
5033
|
+
/** Toggles the dropdown open or closed. */
|
|
4618
5034
|
toggleDropdown() {
|
|
4619
5035
|
const isOpen = this.dropdown.classList.contains("open");
|
|
4620
5036
|
if (isOpen) {
|
|
@@ -4624,16 +5040,19 @@ class YumeSelect extends HTMLElement {
|
|
|
4624
5040
|
this.selectContainer.classList.add("open");
|
|
4625
5041
|
this._positionDropdown();
|
|
4626
5042
|
this._onScrollOrResize = this._positionDropdown.bind(this);
|
|
5043
|
+
|
|
4627
5044
|
window.addEventListener("scroll", this._onScrollOrResize, true);
|
|
4628
5045
|
window.addEventListener("resize", this._onScrollOrResize);
|
|
4629
5046
|
document.addEventListener("click", this._onDocumentClick, true);
|
|
4630
5047
|
}
|
|
4631
5048
|
}
|
|
4632
5049
|
|
|
5050
|
+
/** Closes the dropdown. */
|
|
4633
5051
|
closeDropdown() {
|
|
4634
5052
|
this.dropdown?.classList.remove("open");
|
|
4635
5053
|
this.selectContainer?.classList.remove("open");
|
|
4636
5054
|
document.removeEventListener("click", this._onDocumentClick, true);
|
|
5055
|
+
|
|
4637
5056
|
if (this._onScrollOrResize) {
|
|
4638
5057
|
window.removeEventListener("scroll", this._onScrollOrResize, true);
|
|
4639
5058
|
window.removeEventListener("resize", this._onScrollOrResize);
|
|
@@ -4644,11 +5063,13 @@ class YumeSelect extends HTMLElement {
|
|
|
4644
5063
|
_positionDropdown() {
|
|
4645
5064
|
const rect = this.selectContainer.getBoundingClientRect();
|
|
4646
5065
|
const gap = 4;
|
|
5066
|
+
|
|
4647
5067
|
this.dropdown.style.left = `${rect.left}px`;
|
|
4648
5068
|
this.dropdown.style.width = `${rect.width}px`;
|
|
4649
5069
|
|
|
4650
5070
|
const spaceBelow = window.innerHeight - rect.bottom - gap;
|
|
4651
5071
|
const maxH = 200;
|
|
5072
|
+
|
|
4652
5073
|
if (spaceBelow >= maxH || spaceBelow >= rect.top) {
|
|
4653
5074
|
this.dropdown.style.top = `${rect.bottom + gap}px`;
|
|
4654
5075
|
this.dropdown.style.bottom = "auto";
|
|
@@ -4716,6 +5137,7 @@ class YumeSelect extends HTMLElement {
|
|
|
4716
5137
|
renderTags() {
|
|
4717
5138
|
const isMulti = this.hasAttribute("multiple");
|
|
4718
5139
|
const isTagMode = this.getAttribute("display-mode") === "tag";
|
|
5140
|
+
|
|
4719
5141
|
if (!isMulti || !isTagMode || !this.displayElement) return;
|
|
4720
5142
|
|
|
4721
5143
|
const options = this.getOptions();
|
|
@@ -5046,6 +5468,7 @@ class YumeSlider extends HTMLElement {
|
|
|
5046
5468
|
}
|
|
5047
5469
|
}
|
|
5048
5470
|
|
|
5471
|
+
/** @type {number} The current slider value, clamped between min and max. */
|
|
5049
5472
|
get value() {
|
|
5050
5473
|
const val = parseFloat(this.getAttribute("value"));
|
|
5051
5474
|
return Number.isNaN(val) ? 0 : val;
|
|
@@ -5057,6 +5480,7 @@ class YumeSlider extends HTMLElement {
|
|
|
5057
5480
|
this.setAttribute("value", String(stepped));
|
|
5058
5481
|
}
|
|
5059
5482
|
|
|
5483
|
+
/** @type {number} The minimum allowed value. Defaults to 0. */
|
|
5060
5484
|
get min() {
|
|
5061
5485
|
return parseFloat(this.getAttribute("min")) || 0;
|
|
5062
5486
|
}
|
|
@@ -5065,6 +5489,7 @@ class YumeSlider extends HTMLElement {
|
|
|
5065
5489
|
this.setAttribute("min", String(val));
|
|
5066
5490
|
}
|
|
5067
5491
|
|
|
5492
|
+
/** @type {number} The maximum allowed value. Defaults to 100. */
|
|
5068
5493
|
get max() {
|
|
5069
5494
|
return parseFloat(this.getAttribute("max")) || 100;
|
|
5070
5495
|
}
|
|
@@ -5073,6 +5498,7 @@ class YumeSlider extends HTMLElement {
|
|
|
5073
5498
|
this.setAttribute("max", String(val));
|
|
5074
5499
|
}
|
|
5075
5500
|
|
|
5501
|
+
/** @type {number|null} The step increment, or null for continuous. */
|
|
5076
5502
|
get step() {
|
|
5077
5503
|
const s = parseFloat(this.getAttribute("step"));
|
|
5078
5504
|
return Number.isNaN(s) || s <= 0 ? null : s;
|
|
@@ -5086,6 +5512,7 @@ class YumeSlider extends HTMLElement {
|
|
|
5086
5512
|
}
|
|
5087
5513
|
}
|
|
5088
5514
|
|
|
5515
|
+
/** @type {string} The size variant ("small", "medium", or "large"). */
|
|
5089
5516
|
get size() {
|
|
5090
5517
|
return this.getAttribute("size") || "medium";
|
|
5091
5518
|
}
|
|
@@ -5094,6 +5521,7 @@ class YumeSlider extends HTMLElement {
|
|
|
5094
5521
|
this.setAttribute("size", val);
|
|
5095
5522
|
}
|
|
5096
5523
|
|
|
5524
|
+
/** @type {string} The color theme for the slider track and thumb. */
|
|
5097
5525
|
get color() {
|
|
5098
5526
|
return this.getAttribute("color") || "primary";
|
|
5099
5527
|
}
|
|
@@ -5102,6 +5530,7 @@ class YumeSlider extends HTMLElement {
|
|
|
5102
5530
|
this.setAttribute("color", val);
|
|
5103
5531
|
}
|
|
5104
5532
|
|
|
5533
|
+
/** @type {boolean} Whether the slider is disabled. */
|
|
5105
5534
|
get disabled() {
|
|
5106
5535
|
return this.hasAttribute("disabled");
|
|
5107
5536
|
}
|
|
@@ -5111,6 +5540,7 @@ class YumeSlider extends HTMLElement {
|
|
|
5111
5540
|
else this.removeAttribute("disabled");
|
|
5112
5541
|
}
|
|
5113
5542
|
|
|
5543
|
+
/** @type {string} The slider orientation ("horizontal" or "vertical"). */
|
|
5114
5544
|
get orientation() {
|
|
5115
5545
|
return this.getAttribute("orientation") || "horizontal";
|
|
5116
5546
|
}
|
|
@@ -5119,6 +5549,7 @@ class YumeSlider extends HTMLElement {
|
|
|
5119
5549
|
this.setAttribute("orientation", val);
|
|
5120
5550
|
}
|
|
5121
5551
|
|
|
5552
|
+
/** @type {number} The current value as a percentage of the min-max range. */
|
|
5122
5553
|
get percentage() {
|
|
5123
5554
|
const range = this.max - this.min;
|
|
5124
5555
|
if (range <= 0) return 0;
|
|
@@ -5251,6 +5682,7 @@ class YumeSlider extends HTMLElement {
|
|
|
5251
5682
|
Math.min(1, (e.clientX - rect.left) / rect.width),
|
|
5252
5683
|
);
|
|
5253
5684
|
const rawValue = this.min + ratio * (this.max - this.min);
|
|
5685
|
+
|
|
5254
5686
|
this.value = rawValue;
|
|
5255
5687
|
this.dispatchEvent(
|
|
5256
5688
|
new Event("input", { bubbles: true, composed: true }),
|
|
@@ -5422,6 +5854,7 @@ class YumeSwitch extends HTMLElement {
|
|
|
5422
5854
|
}
|
|
5423
5855
|
}
|
|
5424
5856
|
|
|
5857
|
+
/** @type {boolean} Whether the switch is on. */
|
|
5425
5858
|
get checked() {
|
|
5426
5859
|
return this.hasAttribute("checked");
|
|
5427
5860
|
}
|
|
@@ -5432,6 +5865,7 @@ class YumeSwitch extends HTMLElement {
|
|
|
5432
5865
|
this.update();
|
|
5433
5866
|
}
|
|
5434
5867
|
|
|
5868
|
+
/** @type {string} The form value submitted when checked. Defaults to "on". */
|
|
5435
5869
|
get value() {
|
|
5436
5870
|
return this.getAttribute("value") || "on";
|
|
5437
5871
|
}
|
|
@@ -5441,8 +5875,10 @@ class YumeSwitch extends HTMLElement {
|
|
|
5441
5875
|
this.update();
|
|
5442
5876
|
}
|
|
5443
5877
|
|
|
5878
|
+
/** Toggles the checked state and dispatches a "change" event. */
|
|
5444
5879
|
toggle() {
|
|
5445
5880
|
if (this.hasAttribute("disabled")) return;
|
|
5881
|
+
|
|
5446
5882
|
this.checked = !this.checked;
|
|
5447
5883
|
this.dispatchEvent(
|
|
5448
5884
|
new Event("change", { bubbles: true, composed: true }),
|
|
@@ -5462,9 +5898,10 @@ class YumeSwitch extends HTMLElement {
|
|
|
5462
5898
|
|
|
5463
5899
|
_autoHideLabel() {
|
|
5464
5900
|
const slot = this.shadowRoot.querySelector('slot[name="label"]');
|
|
5465
|
-
if (!slot) return;
|
|
5466
5901
|
const wrapper = slot.closest(".label-wrapper");
|
|
5467
|
-
|
|
5902
|
+
|
|
5903
|
+
if (!slot || !wrapper) return;
|
|
5904
|
+
|
|
5468
5905
|
const update = () => {
|
|
5469
5906
|
const hasContent = slot
|
|
5470
5907
|
.assignedNodes({ flatten: true })
|
|
@@ -5477,6 +5914,7 @@ class YumeSwitch extends HTMLElement {
|
|
|
5477
5914
|
);
|
|
5478
5915
|
wrapper.style.display = hasContent ? "" : "none";
|
|
5479
5916
|
};
|
|
5917
|
+
|
|
5480
5918
|
slot.addEventListener("slotchange", update);
|
|
5481
5919
|
update();
|
|
5482
5920
|
}
|
|
@@ -5759,7 +6197,7 @@ class YumeTable extends HTMLElement {
|
|
|
5759
6197
|
super();
|
|
5760
6198
|
this.attachShadow({ mode: "open" });
|
|
5761
6199
|
this._sortField = null;
|
|
5762
|
-
this._sortDir = "none";
|
|
6200
|
+
this._sortDir = "none";
|
|
5763
6201
|
this._parsedData = [];
|
|
5764
6202
|
this._parsedColumns = [];
|
|
5765
6203
|
}
|
|
@@ -5775,6 +6213,7 @@ class YumeTable extends HTMLElement {
|
|
|
5775
6213
|
this.render();
|
|
5776
6214
|
}
|
|
5777
6215
|
|
|
6216
|
+
/** Column definitions as a JSON string or array of { field, header?, sortable? } objects. */
|
|
5778
6217
|
get columns() {
|
|
5779
6218
|
return this.getAttribute("columns");
|
|
5780
6219
|
}
|
|
@@ -5785,6 +6224,7 @@ class YumeTable extends HTMLElement {
|
|
|
5785
6224
|
);
|
|
5786
6225
|
}
|
|
5787
6226
|
|
|
6227
|
+
/** Row data as a JSON string or array of objects keyed by column field names. */
|
|
5788
6228
|
get data() {
|
|
5789
6229
|
return this.getAttribute("data");
|
|
5790
6230
|
}
|
|
@@ -5795,6 +6235,7 @@ class YumeTable extends HTMLElement {
|
|
|
5795
6235
|
);
|
|
5796
6236
|
}
|
|
5797
6237
|
|
|
6238
|
+
/** Whether to show alternating row backgrounds. */
|
|
5798
6239
|
get striped() {
|
|
5799
6240
|
return this.hasAttribute("striped");
|
|
5800
6241
|
}
|
|
@@ -6284,6 +6725,7 @@ class YumeTabs extends HTMLElement {
|
|
|
6284
6725
|
}
|
|
6285
6726
|
}
|
|
6286
6727
|
|
|
6728
|
+
/** @type {Array<Object>} Tab definitions with id, label, slot, and optional disabled flag. */
|
|
6287
6729
|
get options() {
|
|
6288
6730
|
try {
|
|
6289
6731
|
return JSON.parse(this.getAttribute("options") || "[]");
|
|
@@ -6297,6 +6739,7 @@ class YumeTabs extends HTMLElement {
|
|
|
6297
6739
|
this.render();
|
|
6298
6740
|
}
|
|
6299
6741
|
|
|
6742
|
+
/** @type {"small"|"medium"|"large"} Controls tab button padding and gap. */
|
|
6300
6743
|
get size() {
|
|
6301
6744
|
const sz = this.getAttribute("size");
|
|
6302
6745
|
return ["small", "medium", "large"].includes(sz) ? sz : "medium";
|
|
@@ -6308,6 +6751,7 @@ class YumeTabs extends HTMLElement {
|
|
|
6308
6751
|
else this.setAttribute("size", "medium");
|
|
6309
6752
|
}
|
|
6310
6753
|
|
|
6754
|
+
/** @type {"top"|"bottom"|"left"|"right"} Which edge the tab strip is placed on. */
|
|
6311
6755
|
get position() {
|
|
6312
6756
|
const pos = this.getAttribute("position");
|
|
6313
6757
|
return ["top", "bottom", "left", "right"].includes(pos) ? pos : "top";
|
|
@@ -6319,6 +6763,10 @@ class YumeTabs extends HTMLElement {
|
|
|
6319
6763
|
else this.setAttribute("position", "top");
|
|
6320
6764
|
}
|
|
6321
6765
|
|
|
6766
|
+
/**
|
|
6767
|
+
* Activates a tab by its id.
|
|
6768
|
+
* @param {string} id - The id of the tab to activate.
|
|
6769
|
+
*/
|
|
6322
6770
|
activateTab(id) {
|
|
6323
6771
|
const tab = this.options.find((t) => t.id === id);
|
|
6324
6772
|
if (!tab || tab.disabled) return;
|
|
@@ -6467,6 +6915,7 @@ class YumeTabs extends HTMLElement {
|
|
|
6467
6915
|
const isActive = tab.id === this._activeTab;
|
|
6468
6916
|
const isDisabled = !!tab.disabled;
|
|
6469
6917
|
const btn = document.createElement("button");
|
|
6918
|
+
|
|
6470
6919
|
btn.id = `tab-${tab.id}`;
|
|
6471
6920
|
btn.setAttribute("role", "tab");
|
|
6472
6921
|
btn.setAttribute("part", "tab");
|
|
@@ -6510,6 +6959,7 @@ class YumeTabs extends HTMLElement {
|
|
|
6510
6959
|
const contentSlot = document.createElement("slot");
|
|
6511
6960
|
contentSlot.name = slotName;
|
|
6512
6961
|
panel.appendChild(contentSlot);
|
|
6962
|
+
|
|
6513
6963
|
return panel;
|
|
6514
6964
|
}
|
|
6515
6965
|
|
|
@@ -6562,6 +7012,7 @@ class YumeToast extends HTMLElement {
|
|
|
6562
7012
|
this.render();
|
|
6563
7013
|
}
|
|
6564
7014
|
|
|
7015
|
+
/** Screen position for the toast stack (e.g. "top-right", "bottom-center"). */
|
|
6565
7016
|
get position() {
|
|
6566
7017
|
return this.getAttribute("position") || "bottom-right";
|
|
6567
7018
|
}
|
|
@@ -6569,6 +7020,7 @@ class YumeToast extends HTMLElement {
|
|
|
6569
7020
|
this.setAttribute("position", val);
|
|
6570
7021
|
}
|
|
6571
7022
|
|
|
7023
|
+
/** Default auto-dismiss duration in milliseconds. */
|
|
6572
7024
|
get duration() {
|
|
6573
7025
|
return parseInt(this.getAttribute("duration") ?? "4000", 10);
|
|
6574
7026
|
}
|
|
@@ -6576,6 +7028,7 @@ class YumeToast extends HTMLElement {
|
|
|
6576
7028
|
this.setAttribute("duration", String(val));
|
|
6577
7029
|
}
|
|
6578
7030
|
|
|
7031
|
+
/** Maximum number of toasts visible at once. */
|
|
6579
7032
|
get max() {
|
|
6580
7033
|
return parseInt(this.getAttribute("max") ?? "5", 10);
|
|
6581
7034
|
}
|
|
@@ -6668,6 +7121,7 @@ class YumeToast extends HTMLElement {
|
|
|
6668
7121
|
return toast;
|
|
6669
7122
|
}
|
|
6670
7123
|
|
|
7124
|
+
/** Dismisses all visible toasts. */
|
|
6671
7125
|
clear() {
|
|
6672
7126
|
const container = this.shadowRoot.querySelector(".toast-container");
|
|
6673
7127
|
if (!container) return;
|
|
@@ -6678,8 +7132,11 @@ class YumeToast extends HTMLElement {
|
|
|
6678
7132
|
|
|
6679
7133
|
_removeToast(toast) {
|
|
6680
7134
|
if (!toast || toast._removing) return;
|
|
7135
|
+
|
|
6681
7136
|
toast._removing = true;
|
|
7137
|
+
|
|
6682
7138
|
clearTimeout(toast._timeout);
|
|
7139
|
+
|
|
6683
7140
|
toast.classList.remove("visible");
|
|
6684
7141
|
toast.classList.add("exit");
|
|
6685
7142
|
toast.addEventListener(
|
|
@@ -6829,6 +7286,7 @@ class YumeTooltip extends HTMLElement {
|
|
|
6829
7286
|
this.render();
|
|
6830
7287
|
}
|
|
6831
7288
|
|
|
7289
|
+
/** The tooltip text content. */
|
|
6832
7290
|
get text() {
|
|
6833
7291
|
return this.getAttribute("text") || "";
|
|
6834
7292
|
}
|
|
@@ -6836,6 +7294,7 @@ class YumeTooltip extends HTMLElement {
|
|
|
6836
7294
|
this.setAttribute("text", val);
|
|
6837
7295
|
}
|
|
6838
7296
|
|
|
7297
|
+
/** Placement relative to the trigger: "top" | "bottom" | "left" | "right". */
|
|
6839
7298
|
get position() {
|
|
6840
7299
|
return this.getAttribute("position") || "top";
|
|
6841
7300
|
}
|
|
@@ -6843,6 +7302,7 @@ class YumeTooltip extends HTMLElement {
|
|
|
6843
7302
|
this.setAttribute("position", val);
|
|
6844
7303
|
}
|
|
6845
7304
|
|
|
7305
|
+
/** Delay in milliseconds before the tooltip appears. */
|
|
6846
7306
|
get delay() {
|
|
6847
7307
|
return parseInt(this.getAttribute("delay") ?? "200", 10);
|
|
6848
7308
|
}
|
|
@@ -6850,6 +7310,7 @@ class YumeTooltip extends HTMLElement {
|
|
|
6850
7310
|
this.setAttribute("delay", String(val));
|
|
6851
7311
|
}
|
|
6852
7312
|
|
|
7313
|
+
/** Color theme for the tooltip (e.g. "base", "primary", "error"). */
|
|
6853
7314
|
get color() {
|
|
6854
7315
|
return this.getAttribute("color") || "base";
|
|
6855
7316
|
}
|
|
@@ -6857,11 +7318,14 @@ class YumeTooltip extends HTMLElement {
|
|
|
6857
7318
|
this.setAttribute("color", val);
|
|
6858
7319
|
}
|
|
6859
7320
|
|
|
7321
|
+
/** Programmatically shows the tooltip after the configured delay. */
|
|
6860
7322
|
show() {
|
|
6861
7323
|
clearTimeout(this._hideTimeout);
|
|
7324
|
+
|
|
6862
7325
|
this._showTimeout = setTimeout(() => {
|
|
6863
7326
|
this._visible = true;
|
|
6864
7327
|
const tip = this.shadowRoot.querySelector(".tooltip");
|
|
7328
|
+
|
|
6865
7329
|
if (tip) {
|
|
6866
7330
|
const [, fg] = getColorVarPair(this.color);
|
|
6867
7331
|
tip.style.color = fg;
|
|
@@ -6870,6 +7334,7 @@ class YumeTooltip extends HTMLElement {
|
|
|
6870
7334
|
}, this.delay);
|
|
6871
7335
|
}
|
|
6872
7336
|
|
|
7337
|
+
/** Immediately hides the tooltip. */
|
|
6873
7338
|
hide() {
|
|
6874
7339
|
clearTimeout(this._showTimeout);
|
|
6875
7340
|
this._visible = false;
|
|
@@ -7082,6 +7547,10 @@ class YumeTheme extends HTMLElement {
|
|
|
7082
7547
|
this.applyVariablesToHost(variablesCSS + themeCSS);
|
|
7083
7548
|
}
|
|
7084
7549
|
|
|
7550
|
+
/**
|
|
7551
|
+
* Parses CSS custom properties from the given text and sets them on the host element.
|
|
7552
|
+
* @param {string} cssText - Raw CSS containing custom property declarations.
|
|
7553
|
+
*/
|
|
7085
7554
|
applyVariablesToHost(cssText) {
|
|
7086
7555
|
const regex = /--([\w-]+):\s*([^;]+);/g;
|
|
7087
7556
|
let match;
|
|
@@ -7094,6 +7563,7 @@ class YumeTheme extends HTMLElement {
|
|
|
7094
7563
|
}
|
|
7095
7564
|
}
|
|
7096
7565
|
|
|
7566
|
+
/** Removes all theme custom properties previously applied to the host element. */
|
|
7097
7567
|
clearThemeProperties() {
|
|
7098
7568
|
if (this._themeProps) {
|
|
7099
7569
|
for (const prop of this._themeProps) {
|
|
@@ -7108,13 +7578,15 @@ class YumeTheme extends HTMLElement {
|
|
|
7108
7578
|
const style = document.createElement("style");
|
|
7109
7579
|
style.setAttribute("data-yumekit-page-styles", "");
|
|
7110
7580
|
style.textContent = `
|
|
7111
|
-
|
|
7112
|
-
margin: 0;
|
|
7113
|
-
padding: 0;
|
|
7581
|
+
:host {
|
|
7114
7582
|
font-family: var(--font-family-header, "Lexend", sans-serif);
|
|
7115
7583
|
color: var(--base-content--, #000);
|
|
7116
7584
|
font-weight: 300;
|
|
7117
7585
|
}
|
|
7586
|
+
|
|
7587
|
+
:host * {
|
|
7588
|
+
color: var(--base-content--, #000);
|
|
7589
|
+
}
|
|
7118
7590
|
`;
|
|
7119
7591
|
document.head.appendChild(style);
|
|
7120
7592
|
}
|