@scalar/components 0.35.5 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ScalarButton/ScalarButton.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarButton/ScalarButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarCard/ScalarCardHeader.vue.d.ts.map +1 -1
- package/dist/components/ScalarCard/ScalarCardHeader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ScalarCard/ScalarCardHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue.d.ts +8 -0
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue.d.ts.map +1 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue.d.ts.map +1 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarCodeBlock/constants.d.ts +2 -1
- package/dist/components/ScalarCodeBlock/constants.d.ts.map +1 -1
- package/dist/components/ScalarCodeBlock/constants.js +2 -1
- package/dist/components/ScalarCodeBlock/constants.js.map +1 -1
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarCombobox.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/ScalarCombobox/ScalarCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarDialog/ScalarDialog.vue.d.ts +50 -0
- package/dist/components/ScalarDialog/ScalarDialog.vue.d.ts.map +1 -0
- package/dist/components/ScalarDialog/ScalarDialog.vue.js +6 -0
- package/dist/components/ScalarDialog/ScalarDialog.vue.js.map +1 -0
- package/dist/components/ScalarDialog/ScalarDialog.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/components/ScalarDialog/ScalarDialog.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/ScalarDialog/index.d.ts +4 -0
- package/dist/components/ScalarDialog/index.d.ts.map +1 -0
- package/dist/components/ScalarDialog/index.js +1 -0
- package/dist/components/ScalarDialog/types.d.ts +15 -0
- package/dist/components/ScalarDialog/types.d.ts.map +1 -0
- package/dist/components/ScalarDialog/useBackdropClick.d.ts +46 -0
- package/dist/components/ScalarDialog/useBackdropClick.d.ts.map +1 -0
- package/dist/components/ScalarDialog/useBackdropClick.js +60 -0
- package/dist/components/ScalarDialog/useBackdropClick.js.map +1 -0
- package/dist/components/ScalarDialog/useScrollLock.d.ts +16 -0
- package/dist/components/ScalarDialog/useScrollLock.d.ts.map +1 -0
- package/dist/components/ScalarDialog/useScrollLock.js +70 -0
- package/dist/components/ScalarDialog/useScrollLock.js.map +1 -0
- package/dist/components/ScalarDropdown/ScalarDropdown.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/ScalarDropdown/ScalarDropdown.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarFloating/types.d.ts +3 -2
- package/dist/components/ScalarFloating/types.d.ts.map +1 -1
- package/dist/components/ScalarForm/ScalarFormError.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ScalarForm/ScalarFormField.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarForm/ScalarFormField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarForm/ScalarFormInput.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarForm/ScalarFormInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarForm/ScalarFormInputGroup.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarForm/ScalarFormInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarHeader/ScalarHeader.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarHeader/ScalarHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarHeader/ScalarHeaderButton.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarHeader/ScalarHeaderButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuLink.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarMenu/ScalarMenuLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarPopover/ScalarPopover.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/ScalarPopover/ScalarPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSection.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSection.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarVirtualCodeBlock/ScalarVirtualCodeBlock.vue.d.ts +4 -0
- package/dist/components/ScalarVirtualCodeBlock/ScalarVirtualCodeBlock.vue.d.ts.map +1 -1
- package/dist/components/ScalarVirtualCodeBlock/ScalarVirtualCodeBlock.vue_vue_type_script_setup_true_lang.js +6 -2
- package/dist/components/ScalarVirtualCodeBlock/ScalarVirtualCodeBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/style.css +30 -0
- package/package.json +17 -12
|
@@ -8,7 +8,14 @@ var _hoisted_1 = {
|
|
|
8
8
|
var ScalarFormField_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
9
|
inheritAttrs: false,
|
|
10
10
|
__name: "ScalarFormField",
|
|
11
|
-
props: { is: {
|
|
11
|
+
props: { is: {
|
|
12
|
+
type: [
|
|
13
|
+
String,
|
|
14
|
+
Object,
|
|
15
|
+
Function
|
|
16
|
+
],
|
|
17
|
+
default: "label"
|
|
18
|
+
} },
|
|
12
19
|
setup(__props) {
|
|
13
20
|
const { cx } = useBindCx();
|
|
14
21
|
return (_ctx, _cache) => {
|
package/dist/components/ScalarForm/ScalarFormField.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarFormField.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createBlock","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_unref","_withCtx","_createElementBlock","_renderSlot","_normalizeClass"],"sources":["../../../src/components/ScalarForm/ScalarFormField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Form Field component\n *\n * A single form input field with a label.\n *\n * @example\n * <ScalarFormField>\n * <template #label>Input Label</template>\n * <ScalarTextInput ... />\n * </ScalarFormField>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nconst { is = 'label' } = defineProps<{\n is?: string | Component\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"cx('flex flex-col gap-1.5 rounded')\">\n <div\n v-if=\"$slots.label\"\n class=\"text-c-1 flex items-start justify-between gap-2 text-sm/none font-medium whitespace-nowrap\">\n <slot name=\"label\" />\n </div>\n <slot />\n <span\n v-if=\"$slots.below\"\n :class=\"cx('-mt-1.5 text-sm')\">\n <slot name=\"below\" />\n </span>\n </component>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarFormField.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createBlock","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_unref","_withCtx","_createElementBlock","_renderSlot","_normalizeClass"],"sources":["../../../src/components/ScalarForm/ScalarFormField.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Form Field component\n *\n * A single form input field with a label.\n *\n * @example\n * <ScalarFormField>\n * <template #label>Input Label</template>\n * <ScalarTextInput ... />\n * </ScalarFormField>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nconst { is = 'label' } = defineProps<{\n is?: string | Component\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"cx('flex flex-col gap-1.5 rounded')\">\n <div\n v-if=\"$slots.label\"\n class=\"text-c-1 flex items-start justify-between gap-2 text-sm/none font-medium whitespace-nowrap\">\n <slot name=\"label\" />\n </div>\n <slot />\n <span\n v-if=\"$slots.below\"\n :class=\"cx('-mt-1.5 text-sm')\">\n <slot name=\"below\" />\n </span>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAuBA,MAAM,EAAE,OAAO,UAAU;;GAGvB,OAAAC,UAAA,GAAAC,YAcYC,wBAbL,QAAA,EAAE,GAAAC,eAAAC,mBACCC,MAAA,EAAA,CAAE,CAAA,+BAAA,CAAA,CAAA,GAAA;IACV,SAAAC,cAIM;KAHEP,KAAAA,OAAO,SADfC,UAAA,GAAAO,mBAIM,OAJN,YAIM,CADJC,WAAqB,KAAA,QAAA,OAAA,C;KAEvBA,WAAQ,KAAA,QAAA,SAAA;KAEAT,KAAAA,OAAO,SADfC,UAAA,GAAAO,mBAIO,QAAA;;MAFJ,OAAKE,eAAEJ,MAAA,EAAA,CAAE,CAAA,iBAAA,CAAA;K,IACVG,WAAqB,KAAA,QAAA,OAAA,C"}
|
|
@@ -4,7 +4,14 @@ import { createBlock, defineComponent, mergeProps, openBlock, renderSlot, resolv
|
|
|
4
4
|
var ScalarFormInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
5
|
inheritAttrs: false,
|
|
6
6
|
__name: "ScalarFormInput",
|
|
7
|
-
props: { is: {
|
|
7
|
+
props: { is: {
|
|
8
|
+
type: [
|
|
9
|
+
String,
|
|
10
|
+
Object,
|
|
11
|
+
Function
|
|
12
|
+
],
|
|
13
|
+
default: "button"
|
|
14
|
+
} },
|
|
8
15
|
setup(__props) {
|
|
9
16
|
const { cx } = useBindCx();
|
|
10
17
|
const grouped = useFormGroupInput();
|
package/dist/components/ScalarForm/ScalarFormInput.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarFormInput.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarForm/ScalarFormInput.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar form input base component\n *\n * Provides a base for styling scalar form inputs and buttons\n *\n * This is used internally by the ScalarTextInput component and others\n * If you want a text input consider using this component\n *\n * Renders a button by default can be used to render any kind of input or input wrapper\n *\n * @example\n * <ScalarFormInput />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { cva, useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nimport { useFormGroupInput } from './useFormGroups'\n\nconst { is = 'button' } = defineProps<{\n is?: string | Component\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\nconst grouped = useFormGroupInput()\n\nconst variants = cva({\n base: [\n // Layout\n 'bg-b-1.5 flex items-center text-c-2 gap-0.75 p-3 text-base',\n //Focus\n 'outline-offset-[-1px] has-[:focus-visible]:outline',\n ],\n variants: {\n grouped: {\n true: 'first:rounded-t-[inherit] last:rounded-b-[inherit]',\n false: 'rounded shadow-border',\n },\n button: { true: 'cursor-pointer hover:bg-b-2' },\n },\n})\n</script>\n<template>\n <component\n :is=\"is\"\n :type=\"is === 'button' ? 'button' : undefined\"\n v-bind=\"cx(variants({ button: is === 'button', grouped }))\">\n <slot />\n </component>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarFormInput.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarForm/ScalarFormInput.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar form input base component\n *\n * Provides a base for styling scalar form inputs and buttons\n *\n * This is used internally by the ScalarTextInput component and others\n * If you want a text input consider using this component\n *\n * Renders a button by default can be used to render any kind of input or input wrapper\n *\n * @example\n * <ScalarFormInput />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { cva, useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nimport { useFormGroupInput } from './useFormGroups'\n\nconst { is = 'button' } = defineProps<{\n is?: string | Component\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\nconst grouped = useFormGroupInput()\n\nconst variants = cva({\n base: [\n // Layout\n 'bg-b-1.5 flex items-center text-c-2 gap-0.75 p-3 text-base',\n //Focus\n 'outline-offset-[-1px] has-[:focus-visible]:outline',\n ],\n variants: {\n grouped: {\n true: 'first:rounded-t-[inherit] last:rounded-b-[inherit]',\n false: 'rounded shadow-border',\n },\n button: { true: 'cursor-pointer hover:bg-b-2' },\n },\n})\n</script>\n<template>\n <component\n :is=\"is\"\n :type=\"is === 'button' ? 'button' : undefined\"\n v-bind=\"cx(variants({ button: is === 'button', grouped }))\">\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EA2BA,MAAM,EAAE,OAAO,UAAU;EAEzB,MAAM,UAAU,kBAAkB;EAElC,MAAM,WAAW,IAAI;GACnB,MAAM,CAEJ,8DAEA,oDACF;GACA,UAAU;IACR,SAAS;KACP,MAAM;KACN,OAAO;IACT;IACA,QAAQ,EAAE,MAAM,8BAA8B;GAChD;EACF,CAAC;;GAGC,OAAAA,UAAA,GAAAC,YAKYC,wBAJL,QAAA,EAAE,GADTC,WAKY,EAHT,MAAM,QAAA,OAAE,WAAA,WAA2B,KAAA,EAC5B,GAAAC,MAAA,EAAA,CAAE,CAACA,MAAA,QAAA,CAAQ,CAAA;IAAA,QAAW,QAAA,OAAE;IAAA,SAAeA,MAAA,OAAA;GAAO,CAAA,CAAA,CAAA,GAAA;IACtD,SAAAC,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,C"}
|
package/dist/components/ScalarForm/ScalarFormInputGroup.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -4,7 +4,14 @@ import { createBlock, defineComponent, guardReactiveProps, normalizeProps, openB
|
|
|
4
4
|
var ScalarFormInputGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
5
|
inheritAttrs: false,
|
|
6
6
|
__name: "ScalarFormInputGroup",
|
|
7
|
-
props: { is: {
|
|
7
|
+
props: { is: {
|
|
8
|
+
type: [
|
|
9
|
+
String,
|
|
10
|
+
Object,
|
|
11
|
+
Function
|
|
12
|
+
],
|
|
13
|
+
default: "div"
|
|
14
|
+
} },
|
|
8
15
|
setup(__props) {
|
|
9
16
|
const { cx } = useBindCx();
|
|
10
17
|
useFormGroup();
|
package/dist/components/ScalarForm/ScalarFormInputGroup.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarFormInputGroup.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_unref","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarForm/ScalarFormInputGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Form Group component\n *\n * Groups a set of ScalarFormInput or their derived components.\n *\n * @example\n * <ScalarFormInputGroup>\n * <!-- Inputs... -->\n * </ScalarFormInputGroup>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nimport { useFormGroup } from './useFormGroups'\n\nconst { is = 'div' } = defineProps<{\n /** The element to render\n *\n * If you want to use the group outside of a ScalarFormField,\n * you can set this to 'fieldset'.\n *\n * @default 'div'\n */\n is?: string | Component\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\nuseFormGroup()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"cx('flex flex-col border rounded divide-y')\">\n <slot />\n </component>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarFormInputGroup.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_unref","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarForm/ScalarFormInputGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Form Group component\n *\n * Groups a set of ScalarFormInput or their derived components.\n *\n * @example\n * <ScalarFormInputGroup>\n * <!-- Inputs... -->\n * </ScalarFormInputGroup>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nimport { useFormGroup } from './useFormGroups'\n\nconst { is = 'div' } = defineProps<{\n /** The element to render\n *\n * If you want to use the group outside of a ScalarFormField,\n * you can set this to 'fieldset'.\n *\n * @default 'div'\n */\n is?: string | Component\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\nuseFormGroup()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"cx('flex flex-col border rounded divide-y')\">\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EA+BA,MAAM,EAAE,OAAO,UAAU;EAEzB,aAAa;;GAGX,OAAAA,UAAA,GAAAC,YAIYC,wBAHL,QAAA,EAAE,GAAAC,eAAAC,mBACCC,MAAA,EAAA,CAAE,CAAA,uCAAA,CAAA,CAAA,GAAA;IACV,SAAAC,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -3,7 +3,14 @@ import { createBlock, defineComponent, guardReactiveProps, normalizeProps, openB
|
|
|
3
3
|
var ScalarHeader_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
4
4
|
inheritAttrs: false,
|
|
5
5
|
__name: "ScalarHeader",
|
|
6
|
-
props: { is: {
|
|
6
|
+
props: { is: {
|
|
7
|
+
type: [
|
|
8
|
+
String,
|
|
9
|
+
Object,
|
|
10
|
+
Function
|
|
11
|
+
],
|
|
12
|
+
default: "header"
|
|
13
|
+
} },
|
|
7
14
|
setup(__props) {
|
|
8
15
|
const { cx } = useBindCx();
|
|
9
16
|
const slots = useSlots();
|
package/dist/components/ScalarHeader/ScalarHeader.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarHeader.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_unref","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarHeader/ScalarHeader.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar header component\n *\n * Provides the header chrome; layout is left to the consumer. Columns hug their\n * content, so give the content-bearing one `flex-1` to take the free space - that\n * is also the column that absorbs the shrinking when space runs out.\n *\n * Headers that used the old middle slot are no longer centred: wrap that content\n * in a `ScalarHeaderColumn` with `justify-center` and give both side columns\n * `flex-1`.\n *\n * @example\n * ```html\n * <ScalarHeader>\n * <ScalarHeaderColumn class=\"flex-1\">\n * <ScalarMenu />\n * </ScalarHeaderColumn>\n * <ScalarHeaderColumn class=\"justify-end\">\n * <ScalarHeaderButton cta>Register</ScalarHeaderButton>\n * </ScalarHeaderColumn>\n * </ScalarHeader>\n * ```\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport { useSlots, type Component } from 'vue'\n\nconst { is = 'header' } = defineProps<{\n /** Render as a `div` when nested inside an existing `header` landmark */\n is?: string | Component\n}>()\n\ndefineSlots<{\n /** The contents of the header, typically `ScalarHeaderColumn` children */\n default?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\nconst slots = useSlots()\n\n// Vue drops content for slots we no longer render, so an unmigrated consumer\n// would otherwise just get an empty header.\nif (slots.start || slots.end) {\n console.warn(\n 'ScalarHeader: the `start` and `end` slots have been removed. Compose `ScalarHeaderColumn` children in the default slot instead.',\n )\n}\n</script>\n<template>\n <component\n :is\n v-bind=\"\n cx(\n 'flex min-h-header min-w-0 items-center justify-between gap-2 border-b px-3',\n 'bg-b-header-1 text-c-header border-border-header',\n )\n \">\n <slot />\n </component>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarHeader.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_unref","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarHeader/ScalarHeader.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar header component\n *\n * Provides the header chrome; layout is left to the consumer. Columns hug their\n * content, so give the content-bearing one `flex-1` to take the free space - that\n * is also the column that absorbs the shrinking when space runs out.\n *\n * Headers that used the old middle slot are no longer centred: wrap that content\n * in a `ScalarHeaderColumn` with `justify-center` and give both side columns\n * `flex-1`.\n *\n * @example\n * ```html\n * <ScalarHeader>\n * <ScalarHeaderColumn class=\"flex-1\">\n * <ScalarMenu />\n * </ScalarHeaderColumn>\n * <ScalarHeaderColumn class=\"justify-end\">\n * <ScalarHeaderButton cta>Register</ScalarHeaderButton>\n * </ScalarHeaderColumn>\n * </ScalarHeader>\n * ```\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport { useSlots, type Component } from 'vue'\n\nconst { is = 'header' } = defineProps<{\n /** Render as a `div` when nested inside an existing `header` landmark */\n is?: string | Component\n}>()\n\ndefineSlots<{\n /** The contents of the header, typically `ScalarHeaderColumn` children */\n default?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\nconst slots = useSlots()\n\n// Vue drops content for slots we no longer render, so an unmigrated consumer\n// would otherwise just get an empty header.\nif (slots.start || slots.end) {\n console.warn(\n 'ScalarHeader: the `start` and `end` slots have been removed. Compose `ScalarHeaderColumn` children in the default slot instead.',\n )\n}\n</script>\n<template>\n <component\n :is\n v-bind=\"\n cx(\n 'flex min-h-header min-w-0 items-center justify-between gap-2 border-b px-3',\n 'bg-b-header-1 text-c-header border-border-header',\n )\n \">\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAyCA,MAAM,EAAE,OAAO,UAAU;EACzB,MAAM,QAAQ,SAAS;EAIvB,IAAI,MAAM,SAAS,MAAM,KACvB,QAAQ,KACN,iIACF;;GAIA,OAAAA,UAAA,GAAAC,YASYC,wBART,QAAA,EAAE,GAAAC,eAAAC,mBACYC,MAAA,EAAA,CAAE,C;IAMjB,SAAAC,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,C"}
|
package/dist/components/ScalarHeader/ScalarHeaderButton.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -4,7 +4,14 @@ var ScalarHeaderButton_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
|
|
|
4
4
|
inheritAttrs: false,
|
|
5
5
|
__name: "ScalarHeaderButton",
|
|
6
6
|
props: {
|
|
7
|
-
is: {
|
|
7
|
+
is: {
|
|
8
|
+
type: [
|
|
9
|
+
String,
|
|
10
|
+
Object,
|
|
11
|
+
Function
|
|
12
|
+
],
|
|
13
|
+
default: "button"
|
|
14
|
+
},
|
|
8
15
|
cta: { type: Boolean }
|
|
9
16
|
},
|
|
10
17
|
setup(__props) {
|
package/dist/components/ScalarHeader/ScalarHeaderButton.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarHeaderButton.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarHeader/ScalarHeaderButton.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar header button component\n *\n * Used within the ScalarHeader component\n *\n * @example\n * ```html\n * <ScalarHeaderButton>\n * Login\n * </ScalarHeaderButton>\n * ```\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { cva, useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nconst { is = 'button' } = defineProps<{\n is?: string | Component\n cta?: boolean\n}>()\n\ndefineSlots<{\n /** The contents of the button */\n default?(): unknown\n}>()\n\nconst variants = cva({\n base: 'group/button flex items-center rounded px-3 py-2 text-base/4 no-underline',\n variants: {\n cta: {\n true: 'font-bold bg-b-header-cta text-sm/4 text-c-header-cta hover:bg-h-header-cta',\n false: 'text-c-header-2 hover:text-c-header-1',\n },\n },\n})\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n :type=\"is === 'button' ? 'button' : undefined\"\n v-bind=\"cx(variants({ cta }))\">\n <slot />\n </component>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarHeaderButton.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarHeader/ScalarHeaderButton.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar header button component\n *\n * Used within the ScalarHeader component\n *\n * @example\n * ```html\n * <ScalarHeaderButton>\n * Login\n * </ScalarHeaderButton>\n * ```\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { cva, useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nconst { is = 'button' } = defineProps<{\n is?: string | Component\n cta?: boolean\n}>()\n\ndefineSlots<{\n /** The contents of the button */\n default?(): unknown\n}>()\n\nconst variants = cva({\n base: 'group/button flex items-center rounded px-3 py-2 text-base/4 no-underline',\n variants: {\n cta: {\n true: 'font-bold bg-b-header-cta text-sm/4 text-c-header-cta hover:bg-h-header-cta',\n false: 'text-c-header-2 hover:text-c-header-1',\n },\n },\n})\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n :type=\"is === 'button' ? 'button' : undefined\"\n v-bind=\"cx(variants({ cta }))\">\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EA6BA,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,KAAK;IACH,MAAM;IACN,OAAO;GACT,EACF;EACF,CAAC;EAGD,MAAM,EAAE,OAAO,UAAU;;GAGvB,OAAAA,UAAA,GAAAC,YAKYC,wBAJL,QAAA,EAAE,GADTC,WAKY,EAHT,MAAM,QAAA,OAAE,WAAA,WAA2B,KAAA,EAC5B,GAAAC,MAAA,EAAA,CAAE,CAACA,MAAA,QAAA,CAAQ,CAAA,EAAA,KAAG,QAAA,IAAG,CAAA,CAAA,CAAA,GAAA;IACzB,SAAAC,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -21,7 +21,11 @@ var ScalarListbox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
21
21
|
Function
|
|
22
22
|
] },
|
|
23
23
|
resize: { type: Boolean },
|
|
24
|
-
target: {
|
|
24
|
+
target: { type: [
|
|
25
|
+
String,
|
|
26
|
+
Object,
|
|
27
|
+
Function
|
|
28
|
+
] },
|
|
25
29
|
middleware: {},
|
|
26
30
|
teleport: { type: [Boolean, String] }
|
|
27
31
|
},
|
package/dist/components/ScalarListbox/ScalarListbox.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarListbox.vue_vue_type_script_setup_true_lang.js","names":["$emit","$props","_openBlock","_createBlock","_unref","_withCtx","_createTextVNode","_toDisplayString","_createVNode","ScalarFloating","_mergeProps","_createElementBlock","_createElementVNode","_Fragment","_renderList","ScalarListboxOption","_renderSlot"],"sources":["../../../src/components/ScalarListbox/ScalarListbox.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Listbox component\n *\n * A dropdown select component built on HeadlessUI Listbox.\n * Supports single and multiple selection modes.\n *\n * @example\n * <ScalarListbox v-model=\"selected\" :options=\"options\">\n * <ScalarButton>{{ selected?.label ?? 'Select' }}</ScalarButton>\n * </ScalarListbox>\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n Listbox,\n ListboxButton,\n ListboxLabel,\n ListboxOptions,\n} from '@headlessui/vue'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport { ScalarFloating, type ScalarFloatingOptions } from '../ScalarFloating'\nimport ScalarListboxOption from './ScalarListboxItem.vue'\nimport type { Option } from './types'\n\ntype SingleSelectListboxProps = {\n multiple?: false | undefined\n modelValue?: Option | undefined\n}\n\ntype MultipleSelectListboxProps = {\n multiple: true\n modelValue?: Option[] | undefined\n}\n\ndefineProps<\n {\n options: Option[]\n id?: string\n label?: string\n } & (SingleSelectListboxProps | MultipleSelectListboxProps) &\n ScalarFloatingOptions\n>()\n\ndefineEmits<{\n (e: 'update:modelValue', v: Option): void\n}>()\n\ndefineSlots<{\n /** The reference element for the listbox */\n default(props: {\n /** Whether or not the listbox is open */\n open: boolean\n }): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <Listbox\n v-slot=\"{ open }\"\n :modelValue=\"modelValue\"\n :multiple=\"multiple\"\n @update:modelValue=\"(v) => $emit('update:modelValue', v)\">\n <ListboxLabel\n v-if=\"label\"\n class=\"sr-only\">\n {{ label }}\n </ListboxLabel>\n <ScalarFloating\n v-bind=\"$props\"\n :placement=\"placement ?? 'bottom-start'\">\n <ListboxButton\n :id=\"id\"\n as=\"template\">\n <slot :open=\"open\" />\n </ListboxButton>\n <template #floating=\"{ width }\">\n <!-- Background container -->\n <div\n v-if=\"open\"\n :style=\"{ width }\"\n v-bind=\"\n cx(\n 'relative flex max-h-[inherit] w-40 max-w-[inherit] rounded-xl bg-b-1 dark:bg-b-1.5 text-sm shadow-md inset-shadow-border',\n )\n \">\n <!-- Scroll container -->\n <div class=\"custom-scroll min-h-0 flex-1 rounded-[inherit]\">\n <!-- Options list -->\n <ListboxOptions\n class=\"flex flex-col gap-0.75 p-0.75 -outline-offset-1\">\n <ScalarListboxOption\n v-for=\"option in options\"\n :key=\"option.id\"\n :multiselect=\"multiple\"\n :option=\"option\" />\n </ListboxOptions>\n </div>\n </div>\n </template>\n </ScalarFloating>\n </Listbox>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarListbox.vue_vue_type_script_setup_true_lang.js","names":["$emit","$props","_openBlock","_createBlock","_unref","_withCtx","_createTextVNode","_toDisplayString","_createVNode","ScalarFloating","_mergeProps","_createElementBlock","_createElementVNode","_Fragment","_renderList","ScalarListboxOption","_renderSlot"],"sources":["../../../src/components/ScalarListbox/ScalarListbox.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Listbox component\n *\n * A dropdown select component built on HeadlessUI Listbox.\n * Supports single and multiple selection modes.\n *\n * @example\n * <ScalarListbox v-model=\"selected\" :options=\"options\">\n * <ScalarButton>{{ selected?.label ?? 'Select' }}</ScalarButton>\n * </ScalarListbox>\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport {\n Listbox,\n ListboxButton,\n ListboxLabel,\n ListboxOptions,\n} from '@headlessui/vue'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport { ScalarFloating, type ScalarFloatingOptions } from '../ScalarFloating'\nimport ScalarListboxOption from './ScalarListboxItem.vue'\nimport type { Option } from './types'\n\ntype SingleSelectListboxProps = {\n multiple?: false | undefined\n modelValue?: Option | undefined\n}\n\ntype MultipleSelectListboxProps = {\n multiple: true\n modelValue?: Option[] | undefined\n}\n\ndefineProps<\n {\n options: Option[]\n id?: string\n label?: string\n } & (SingleSelectListboxProps | MultipleSelectListboxProps) &\n ScalarFloatingOptions\n>()\n\ndefineEmits<{\n (e: 'update:modelValue', v: Option): void\n}>()\n\ndefineSlots<{\n /** The reference element for the listbox */\n default(props: {\n /** Whether or not the listbox is open */\n open: boolean\n }): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <Listbox\n v-slot=\"{ open }\"\n :modelValue=\"modelValue\"\n :multiple=\"multiple\"\n @update:modelValue=\"(v) => $emit('update:modelValue', v)\">\n <ListboxLabel\n v-if=\"label\"\n class=\"sr-only\">\n {{ label }}\n </ListboxLabel>\n <ScalarFloating\n v-bind=\"$props\"\n :placement=\"placement ?? 'bottom-start'\">\n <ListboxButton\n :id=\"id\"\n as=\"template\">\n <slot :open=\"open\" />\n </ListboxButton>\n <template #floating=\"{ width }\">\n <!-- Background container -->\n <div\n v-if=\"open\"\n :style=\"{ width }\"\n v-bind=\"\n cx(\n 'relative flex max-h-[inherit] w-40 max-w-[inherit] rounded-xl bg-b-1 dark:bg-b-1.5 text-sm shadow-md inset-shadow-border',\n )\n \">\n <!-- Scroll container -->\n <div class=\"custom-scroll min-h-0 flex-1 rounded-[inherit]\">\n <!-- Options list -->\n <ListboxOptions\n class=\"flex flex-col gap-0.75 p-0.75 -outline-offset-1\">\n <ScalarListboxOption\n v-for=\"option in options\"\n :key=\"option.id\"\n :multiselect=\"multiple\"\n :option=\"option\" />\n </ListboxOptions>\n </div>\n </div>\n </template>\n </ScalarFloating>\n </Listbox>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DA,MAAM,EAAE,OAAO,UAAU;;GAGvB,OAAAE,UAAA,GAAAC,YA2CUC,MAAA,OAAA,GAAA;IAzCP,YAAY,QAAA;IACZ,UAAU,QAAA;IACV,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAMJ,KAAAA,MAAK,qBAAsB,CAAC;;IACvD,SAAAK,SAIe,EARL,WAAI,CAKN,QAAA,SADRH,UAAA,GAAAC,YAIeC,MAAA,YAAA,GAAA;;KAFb,OAAM;;KACN,SAAAC,cAAW,CAARC,gBAAAC,gBAAA,QAAA,KAAK,GAAA,CAAA,C;;I,oCAEVC,YAgCiBJ,MAAAK,sBAAA,GAhCjBC,WACUT,KA+BO,QA/BD,EACb,WAAW,QAAA,aAAS,e;KAMV,UAAQI,SAsBX,EAtBe,YAAK,CAGlB,QADRH,UAAA,GAAAS,mBAoBM,OApBND,WAoBM;;MAlBH,OAAK,EAAI,MAAK;K,GACMN,MAAA,EAAA,CAAE,C,+HAMvBQ,mBAUM,OAVN,YAUM,CARJJ,YAOiBJ,MAAA,cAAA,GAAA,EANf,OAAM,kDAAiD,GAAA;MAErD,SAAAC,cAAyB,EAD3BH,UAAA,IAAA,GAAAS,mBAIqBE,UAAA,MAAAC,WAHF,QAAA,UAAV,WAAM;OADf,OAAAZ,UAAA,GAAAC,YAIqBY,2BAAA;QAFlB,KAAK,OAAO;QACZ,aAAa,QAAA;QACL;;;;;KAxBnB,SAAAV,cAIgB,CAJhBG,YAIgBJ,MAAA,aAAA,GAAA;MAHb,IAAI,QAAA;MACL,IAAG;;MACH,SAAAC,cAAqB,CAArBW,WAAqB,KAAA,QAAA,WAAA,EAAR,KAAI,CAAA,C"}
|
|
@@ -12,7 +12,14 @@ var ScalarMenuLink_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
12
12
|
inheritAttrs: false,
|
|
13
13
|
__name: "ScalarMenuLink",
|
|
14
14
|
props: {
|
|
15
|
-
is: {
|
|
15
|
+
is: {
|
|
16
|
+
type: [
|
|
17
|
+
String,
|
|
18
|
+
Object,
|
|
19
|
+
Function
|
|
20
|
+
],
|
|
21
|
+
default: "a"
|
|
22
|
+
},
|
|
16
23
|
icon: { type: [Object, Function] },
|
|
17
24
|
strong: { type: Boolean },
|
|
18
25
|
submenu: { type: Boolean }
|
package/dist/components/ScalarMenu/ScalarMenuLink.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarMenuLink.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","ScalarDropdownButton","_mergeProps","_withCtx","ScalarIconLegacyAdapter","_normalizeClass","_createElementBlock","_createElementVNode","_renderSlot"],"sources":["../../../src/components/ScalarMenu/ScalarMenuLink.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Menu Link component\n *\n * A menu item that renders as a link with an optional icon.\n * Used within ScalarMenu sections.\n *\n * @example\n * <ScalarMenuLink href=\"https://example.com\" :icon=\"ScalarIconBook\">\n * Documentation\n * </ScalarMenuLink>\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport { DropdownMenu } from 'radix-vue/namespaced'\nimport type { Component } from 'vue'\n\nimport { ScalarDropdownButton } from '../ScalarDropdown'\nimport { ScalarIconLegacyAdapter, type Icon } from '../ScalarIcon'\n\nconst { is = 'a' } = defineProps<{\n is?: string | Component\n icon?: Icon | ScalarIconComponent\n strong?: boolean\n submenu?: boolean\n}>()\n\nconst { cx } = useBindCx()\ndefineOptions({ inheritAttrs: false })\n</script>\n<template>\n <ScalarDropdownButton\n v-bind=\"cx('flex items-center')\"\n :is=\"submenu ? DropdownMenu.SubTrigger : DropdownMenu.Item\"\n :as=\"is\">\n <ScalarIconLegacyAdapter\n v-if=\"icon\"\n :class=\"[\n strong ? 'text-c-1' : 'text-c-2',\n typeof icon === 'string' ? 'size-3' : '-mx-px size-3.5',\n ]\"\n :icon=\"icon\"\n :thickness=\"strong ? '2.5' : '2'\"\n :weight=\"strong ? 'bold' : 'regular'\" />\n <div\n v-else\n class=\"size-3\" />\n <div\n class=\"flex min-w-0 flex-1 items-center truncate\"\n :class=\"strong ? 'font-medium' : 'font-normal'\">\n <slot />\n </div>\n </ScalarDropdownButton>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarMenuLink.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","ScalarDropdownButton","_mergeProps","_withCtx","ScalarIconLegacyAdapter","_normalizeClass","_createElementBlock","_createElementVNode","_renderSlot"],"sources":["../../../src/components/ScalarMenu/ScalarMenuLink.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Menu Link component\n *\n * A menu item that renders as a link with an optional icon.\n * Used within ScalarMenu sections.\n *\n * @example\n * <ScalarMenuLink href=\"https://example.com\" :icon=\"ScalarIconBook\">\n * Documentation\n * </ScalarMenuLink>\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport { DropdownMenu } from 'radix-vue/namespaced'\nimport type { Component } from 'vue'\n\nimport { ScalarDropdownButton } from '../ScalarDropdown'\nimport { ScalarIconLegacyAdapter, type Icon } from '../ScalarIcon'\n\nconst { is = 'a' } = defineProps<{\n is?: string | Component\n icon?: Icon | ScalarIconComponent\n strong?: boolean\n submenu?: boolean\n}>()\n\nconst { cx } = useBindCx()\ndefineOptions({ inheritAttrs: false })\n</script>\n<template>\n <ScalarDropdownButton\n v-bind=\"cx('flex items-center')\"\n :is=\"submenu ? DropdownMenu.SubTrigger : DropdownMenu.Item\"\n :as=\"is\">\n <ScalarIconLegacyAdapter\n v-if=\"icon\"\n :class=\"[\n strong ? 'text-c-1' : 'text-c-2',\n typeof icon === 'string' ? 'size-3' : '-mx-px size-3.5',\n ]\"\n :icon=\"icon\"\n :thickness=\"strong ? '2.5' : '2'\"\n :weight=\"strong ? 'bold' : 'regular'\" />\n <div\n v-else\n class=\"size-3\" />\n <div\n class=\"flex min-w-0 flex-1 items-center truncate\"\n :class=\"strong ? 'font-medium' : 'font-normal'\">\n <slot />\n </div>\n </ScalarDropdownButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BA,MAAM,EAAE,OAAO,UAAU;;GAIvB,OAAAA,UAAA,GAAAC,YAqBuBC,MAAAC,4BAAA,GArBvBC,WACUF,MAoBa,EAAA,CApBX,CAAA,mBAAA,GAAA;IACT,IAAI,QAAA,UAAUA,MAAA,YAAA,CAAY,CAAC,aAAaA,MAAA,YAAA,CAAY,CAAC;IACrD,IAAI,QAAA;;IACL,SAAAG,cAQ0C,CAPlC,QAAA,QADRL,UAAA,GAAAC,YAQ0CC,MAAAI,+BAAA,GAAA;;KANvC,OAAKC,eAAA,CAAY,QAAA,SAAM,aAAA,YAA2C,OAAA,QAAA,SAAI,WAAA,WAAA,iB;KAItE,MAAM,QAAA;KACN,WAAW,QAAA,SAAM,QAAA;KACjB,QAAQ,QAAA,SAAM,SAAA;;;;;;I,OACjBP,UAAA,GAAAQ,mBAEmB,OAFnB,UAEmB,IACnBC,mBAIM,OAAA,EAHJ,OAAKF,eAAA,CAAC,6CACE,QAAA,SAAM,gBAAA,aAAA,CAAA,E,IACdG,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -5,7 +5,14 @@ var ScalarMenuProduct_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
5
5
|
inheritAttrs: false,
|
|
6
6
|
__name: "ScalarMenuProduct",
|
|
7
7
|
props: {
|
|
8
|
-
is: {
|
|
8
|
+
is: {
|
|
9
|
+
type: [
|
|
10
|
+
String,
|
|
11
|
+
Object,
|
|
12
|
+
Function
|
|
13
|
+
],
|
|
14
|
+
default: "a"
|
|
15
|
+
},
|
|
9
16
|
selected: { type: Boolean },
|
|
10
17
|
icon: { type: [Object, Function] }
|
|
11
18
|
},
|
package/dist/components/ScalarMenu/ScalarMenuProduct.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarMenuProduct.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","ScalarMenuLink","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarMenu/ScalarMenuProduct.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Menu Product component\n *\n * A selectable product entry within the ScalarMenu products list.\n * Highlights the currently active product.\n *\n * @example\n * <ScalarMenuProduct :icon=\"ScalarIconHouse\" :selected=\"true\">\n * Dashboard\n * </ScalarMenuProduct>\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { cva, useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nimport type { Icon } from '../../'\nimport { ScalarMenuLink } from './'\n\nconst { is = 'a' } = defineProps<{\n is?: string | Component\n selected?: boolean\n icon: Icon | ScalarIconComponent\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\nconst variants = cva({\n base: 'gap-1.5',\n variants: {\n selected: {\n true: 'pointer-events-none bg-b-2 dark:bg-b-3',\n false: 'cursor-pointer hover:bg-b-2 dark:hover:bg-b-3',\n },\n },\n})\n</script>\n<template>\n <ScalarMenuLink\n :is=\"is\"\n :icon=\"icon\"\n strong\n target=\"_blank\"\n v-bind=\"cx(variants({ selected }))\">\n <slot />\n </ScalarMenuLink>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarMenuProduct.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","ScalarMenuLink","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarMenu/ScalarMenuProduct.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Menu Product component\n *\n * A selectable product entry within the ScalarMenu products list.\n * Highlights the currently active product.\n *\n * @example\n * <ScalarMenuProduct :icon=\"ScalarIconHouse\" :selected=\"true\">\n * Dashboard\n * </ScalarMenuProduct>\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { cva, useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nimport type { Icon } from '../../'\nimport { ScalarMenuLink } from './'\n\nconst { is = 'a' } = defineProps<{\n is?: string | Component\n selected?: boolean\n icon: Icon | ScalarIconComponent\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\nconst variants = cva({\n base: 'gap-1.5',\n variants: {\n selected: {\n true: 'pointer-events-none bg-b-2 dark:bg-b-3',\n false: 'cursor-pointer hover:bg-b-2 dark:hover:bg-b-3',\n },\n },\n})\n</script>\n<template>\n <ScalarMenuLink\n :is=\"is\"\n :icon=\"icon\"\n strong\n target=\"_blank\"\n v-bind=\"cx(variants({ selected }))\">\n <slot />\n </ScalarMenuLink>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EA8BA,MAAM,EAAE,OAAO,UAAU;EAEzB,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,UAAU;IACR,MAAM;IACN,OAAO;GACT,EACF;EACF,CAAC;;GAGC,OAAAA,UAAA,GAAAC,YAOiBC,MAAAC,sBAAA,GAPjBC,WAOiB;IANd,IAAI,QAAA;IACJ,MAAM,QAAA;IACP,QAAA;IACA,QAAO;GACC,GAAAF,MAAA,EAAA,CAAE,CAACA,MAAA,QAAA,CAAQ,CAAA,EAAA,UAAG,QAAA,SAAQ,CAAA,CAAA,CAAA,GAAA;IAC9B,SAAAG,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -14,7 +14,11 @@ var ScalarPopover_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
14
14
|
Function
|
|
15
15
|
] },
|
|
16
16
|
resize: { type: Boolean },
|
|
17
|
-
target: {
|
|
17
|
+
target: { type: [
|
|
18
|
+
String,
|
|
19
|
+
Object,
|
|
20
|
+
Function
|
|
21
|
+
] },
|
|
18
22
|
middleware: {},
|
|
19
23
|
teleport: { type: [Boolean, String] }
|
|
20
24
|
},
|
package/dist/components/ScalarPopover/ScalarPopover.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarPopover.vue_vue_type_script_setup_true_lang.js","names":["$props","_openBlock","_createBlock","_unref","_withCtx","_createVNode","ScalarFloating","_normalizeProps","_guardReactiveProps","_mergeProps","_renderSlot"],"sources":["../../../src/components/ScalarPopover/ScalarPopover.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Popover component\n *\n * A floating panel that appears when a trigger element is clicked.\n * Built on HeadlessUI Popover with Floating UI positioning.\n *\n * @example\n * <ScalarPopover>\n * <button>Open</button>\n * <template #popover=\"{ close }\">Popover content</template>\n * </ScalarPopover>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { Popover, PopoverButton, PopoverPanel } from '@headlessui/vue'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport { ScalarFloating, type ScalarFloatingOptions } from '../ScalarFloating'\nimport type { Slots } from './types'\n\ndefineProps<\n {\n /** Automatically focus the popover panel when it opens */\n focus?: boolean\n } & ScalarFloatingOptions\n>()\n\ndefineSlots<Slots>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <Popover\n v-slot=\"{ open }\"\n as=\"template\">\n <ScalarFloating v-bind=\"$props\">\n <PopoverButton as=\"template\">\n <slot :open=\"open\" />\n </PopoverButton>\n <template #floating=\"{ width, height }\">\n <PopoverPanel\n v-slot=\"{ close }\"\n :focus=\"focus\"\n :style=\"{ width, height }\"\n v-bind=\"\n cx(\n 'relative flex flex-col rounded-xl bg-b-1 dark:bg-b-1.5 p-0.75 shadow-md inset-shadow-border',\n )\n \">\n <slot\n :close=\"() => close()\"\n name=\"popover\"\n :open=\"open\" />\n </PopoverPanel>\n </template>\n </ScalarFloating>\n </Popover>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarPopover.vue_vue_type_script_setup_true_lang.js","names":["$props","_openBlock","_createBlock","_unref","_withCtx","_createVNode","ScalarFloating","_normalizeProps","_guardReactiveProps","_mergeProps","_renderSlot"],"sources":["../../../src/components/ScalarPopover/ScalarPopover.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Popover component\n *\n * A floating panel that appears when a trigger element is clicked.\n * Built on HeadlessUI Popover with Floating UI positioning.\n *\n * @example\n * <ScalarPopover>\n * <button>Open</button>\n * <template #popover=\"{ close }\">Popover content</template>\n * </ScalarPopover>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { Popover, PopoverButton, PopoverPanel } from '@headlessui/vue'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport { ScalarFloating, type ScalarFloatingOptions } from '../ScalarFloating'\nimport type { Slots } from './types'\n\ndefineProps<\n {\n /** Automatically focus the popover panel when it opens */\n focus?: boolean\n } & ScalarFloatingOptions\n>()\n\ndefineSlots<Slots>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <Popover\n v-slot=\"{ open }\"\n as=\"template\">\n <ScalarFloating v-bind=\"$props\">\n <PopoverButton as=\"template\">\n <slot :open=\"open\" />\n </PopoverButton>\n <template #floating=\"{ width, height }\">\n <PopoverPanel\n v-slot=\"{ close }\"\n :focus=\"focus\"\n :style=\"{ width, height }\"\n v-bind=\"\n cx(\n 'relative flex flex-col rounded-xl bg-b-1 dark:bg-b-1.5 p-0.75 shadow-md inset-shadow-border',\n )\n \">\n <slot\n :close=\"() => close()\"\n name=\"popover\"\n :open=\"open\" />\n </PopoverPanel>\n </template>\n </ScalarFloating>\n </Popover>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAgCA,MAAM,EAAE,OAAO,UAAU;;GAGvB,OAAAC,UAAA,GAAAC,YAwBUC,MAAA,OAAA,GAAA,EAtBR,IAAG,WAAU,GAAA;IACb,SAAAC,SAoBiB,EAtBP,WAAI,CAEdC,YAoBiBF,MAAAG,sBAAA,GAAAC,eAAAC,mBApBOR,KAAAA,MAAM,CAAA,GAAA;KAIjB,UAAQI,SAcF,EAdM,OAAO,aAAM,CAClCC,YAaeF,MAAA,YAAA,GAbfM,WAae;MAXZ,OAAO,QAAA;MACP,OAAK;OAAI;OAAO;MAAM;K,GACFN,MAAA,EAAA,CAAE,C;MAKvB,SAAAC,SAGiB,EAXP,YAAK,CAQfM,WAGiB,KAAA,QAAA,WAAA;OAFd,aAAa,MAAK;OAEZ;;;;KAhBb,SAAAN,cAEgB,CAFhBC,YAEgBF,MAAA,aAAA,GAAA,EAFD,IAAG,WAAU,GAAA;MAC1B,SAAAC,cAAqB,CAArBM,WAAqB,KAAA,QAAA,WAAA,EAAR,KAAI,CAAA,C"}
|
package/dist/components/ScalarSidebar/ScalarSidebarButton.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -12,7 +12,14 @@ var ScalarSidebarButton_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
|
|
|
12
12
|
inheritAttrs: false,
|
|
13
13
|
__name: "ScalarSidebarButton",
|
|
14
14
|
props: {
|
|
15
|
-
is: {
|
|
15
|
+
is: {
|
|
16
|
+
type: [
|
|
17
|
+
Object,
|
|
18
|
+
Function,
|
|
19
|
+
String
|
|
20
|
+
],
|
|
21
|
+
default: "a"
|
|
22
|
+
},
|
|
16
23
|
icon: { type: [Object, Function] },
|
|
17
24
|
active: { type: Boolean },
|
|
18
25
|
selected: { type: Boolean },
|
package/dist/components/ScalarSidebar/ScalarSidebarButton.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarButton.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_withCtx","_renderSlot","_createVNode","ScalarSidebarIndent","_createElementBlock","ScalarIconLegacyAdapter","_createElementVNode"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarButton.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Button component\n *\n * Provide a styled link for the ScalarSidebar or similar, supports\n * the same props and slots as ScalarSidebarItem\n *\n * This is used internally by the ScalarSidebarItem component\n *\n * If you're looking to create items in ScalarSidebarItems\n * you probably want the ScalarSidebarItem component\n *\n * @example\n * <ScalarSidebarButton>\n * <template #icon>\n * <!-- Overrides the icon slot -->\n * </template>\n * <!-- Button text -->\n * <template #aside>\n * <!-- After the button text -->\n * </template>\n * </ScalarSidebarButton>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { cva, useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport { ScalarIconLegacyAdapter } from '../ScalarIcon'\nimport ScalarSidebarIndent from './ScalarSidebarIndent.vue'\nimport type { ScalarSidebarButtonSlots, ScalarSidebarItemProps } from './types'\n\nconst { is = 'a', indent = 0 } = defineProps<ScalarSidebarItemProps>()\n\ndefineSlots<ScalarSidebarButtonSlots>()\n\nconst variants = cva({\n base: [\n 'group/button peer/button flex items-stretch rounded p-2',\n 'font-sidebar text-base/4 text-sidebar-c-2 no-underline wrap-break-word',\n ],\n variants: {\n active: { true: 'text-sidebar-c-active font-sidebar-active' },\n disabled: { true: 'cursor-auto' },\n selected: {\n true: 'cursor-auto bg-sidebar-b-active text-sidebar-c-active font-sidebar-active',\n },\n },\n compoundVariants: [\n {\n selected: false,\n disabled: false,\n active: false,\n class: 'hover:bg-sidebar-b-hover hover:text-sidebar-c-hover',\n },\n {\n selected: false,\n disabled: false,\n active: true,\n class: 'hover:bg-sidebar-b-hover',\n },\n ],\n defaultVariants: { selected: false, disabled: false, active: false },\n})\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n :aria-current=\"selected ? 'page' : undefined\"\n :type=\"is === 'button' ? 'button' : undefined\"\n v-bind=\"cx(variants({ selected, disabled, active }))\">\n <slot name=\"indent\">\n <ScalarSidebarIndent\n class=\"-my-2\"\n :disabled\n :indent\n :selected />\n </slot>\n <div\n v-if=\"icon || $slots.icon\"\n class=\"mr-1 flex h-lh items-center *:size-4\">\n <slot name=\"icon\">\n <ScalarIconLegacyAdapter\n v-if=\"icon\"\n :icon=\"icon\" />\n </slot>\n </div>\n <div class=\"group/button-label min-w-0 flex-1\">\n <slot />\n </div>\n <slot name=\"aside\" />\n </component>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarButton.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_withCtx","_renderSlot","_createVNode","ScalarSidebarIndent","_createElementBlock","ScalarIconLegacyAdapter","_createElementVNode"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarButton.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Button component\n *\n * Provide a styled link for the ScalarSidebar or similar, supports\n * the same props and slots as ScalarSidebarItem\n *\n * This is used internally by the ScalarSidebarItem component\n *\n * If you're looking to create items in ScalarSidebarItems\n * you probably want the ScalarSidebarItem component\n *\n * @example\n * <ScalarSidebarButton>\n * <template #icon>\n * <!-- Overrides the icon slot -->\n * </template>\n * <!-- Button text -->\n * <template #aside>\n * <!-- After the button text -->\n * </template>\n * </ScalarSidebarButton>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { cva, useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport { ScalarIconLegacyAdapter } from '../ScalarIcon'\nimport ScalarSidebarIndent from './ScalarSidebarIndent.vue'\nimport type { ScalarSidebarButtonSlots, ScalarSidebarItemProps } from './types'\n\nconst { is = 'a', indent = 0 } = defineProps<ScalarSidebarItemProps>()\n\ndefineSlots<ScalarSidebarButtonSlots>()\n\nconst variants = cva({\n base: [\n 'group/button peer/button flex items-stretch rounded p-2',\n 'font-sidebar text-base/4 text-sidebar-c-2 no-underline wrap-break-word',\n ],\n variants: {\n active: { true: 'text-sidebar-c-active font-sidebar-active' },\n disabled: { true: 'cursor-auto' },\n selected: {\n true: 'cursor-auto bg-sidebar-b-active text-sidebar-c-active font-sidebar-active',\n },\n },\n compoundVariants: [\n {\n selected: false,\n disabled: false,\n active: false,\n class: 'hover:bg-sidebar-b-hover hover:text-sidebar-c-hover',\n },\n {\n selected: false,\n disabled: false,\n active: true,\n class: 'hover:bg-sidebar-b-hover',\n },\n ],\n defaultVariants: { selected: false, disabled: false, active: false },\n})\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n :aria-current=\"selected ? 'page' : undefined\"\n :type=\"is === 'button' ? 'button' : undefined\"\n v-bind=\"cx(variants({ selected, disabled, active }))\">\n <slot name=\"indent\">\n <ScalarSidebarIndent\n class=\"-my-2\"\n :disabled\n :indent\n :selected />\n </slot>\n <div\n v-if=\"icon || $slots.icon\"\n class=\"mr-1 flex h-lh items-center *:size-4\">\n <slot name=\"icon\">\n <ScalarIconLegacyAdapter\n v-if=\"icon\"\n :icon=\"icon\" />\n </slot>\n </div>\n <div class=\"group/button-label min-w-0 flex-1\">\n <slot />\n </div>\n <slot name=\"aside\" />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCA,MAAM,WAAW,IAAI;GACnB,MAAM,CACJ,2DACA,yEACF;GACA,UAAU;IACR,QAAQ,EAAE,MAAM,4CAA4C;IAC5D,UAAU,EAAE,MAAM,cAAc;IAChC,UAAU,EACR,MAAM,4EACR;GACF;GACA,kBAAkB,CAChB;IACE,UAAU;IACV,UAAU;IACV,QAAQ;IACR,OAAO;GACT,GACA;IACE,UAAU;IACV,UAAU;IACV,QAAQ;IACR,OAAO;GACT,CACF;GACA,iBAAiB;IAAE,UAAU;IAAO,UAAU;IAAO,QAAQ;GAAM;EACrE,CAAC;EAED,MAAM,EAAE,OAAO,UAAU;;GAGvB,OAAAC,UAAA,GAAAC,YAyBYC,wBAxBL,QAAA,EAAE,GADTC,WAyBY;IAvBT,gBAAc,QAAA,WAAQ,SAAY,KAAA;IAClC,MAAM,QAAA,OAAE,WAAA,WAA2B,KAAA;GAC5B,GAAAC,MAAA,EAAA,CAAE,CAACA,MAAA,QAAA,CAAQ,CAAA;IAAA,UAAG,QAAA;IAAQ,UAAE,QAAA;IAAQ,QAAE,QAAA;GAAM,CAAA,CAAA,CAAA,GAAA;IAChD,SAAAC,cAMO;KANPC,WAMO,KAAA,QAAA,UAAA,CAAA,SAAA,CALLC,YAIcC,6BAAA;MAHZ,OAAM;MACL,UAAA,QAAA;MACA,QAAA,QAAA;MACA,UAAA,QAAA;;;;;;KAGG,QAAA,QAAQT,KAAAA,OAAO,QADvBC,UAAA,GAAAS,mBAQM,OARN,YAQM,CALJH,WAIO,KAAA,QAAA,QAAA,CAAA,SAAA,CAFG,QAAA,QADRN,UAAA,GAAAC,YAEiBG,MAAAM,+BAAA,GAAA;;MAAd,MAAM,QAAA;;KAGbC,mBAEM,OAFN,YAEM,CADJL,WAAQ,KAAA,QAAA,SAAA,C;KAEVA,WAAqB,KAAA,QAAA,OAAA"}
|
package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -17,7 +17,14 @@ var ScalarSidebarGroup_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
|
|
|
17
17
|
inheritAttrs: false,
|
|
18
18
|
__name: "ScalarSidebarGroup",
|
|
19
19
|
props: /*@__PURE__*/ mergeModels({
|
|
20
|
-
is: {
|
|
20
|
+
is: {
|
|
21
|
+
type: [
|
|
22
|
+
Object,
|
|
23
|
+
Function,
|
|
24
|
+
String
|
|
25
|
+
],
|
|
26
|
+
default: "li"
|
|
27
|
+
},
|
|
21
28
|
icon: { type: [Object, Function] },
|
|
22
29
|
active: { type: Boolean },
|
|
23
30
|
selected: { type: Boolean },
|
package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarGroup.vue_vue_type_script_setup_true_lang.js","names":["$slots","_useModel","_openBlock","_createBlock","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_unref","_withCtx","_createElementVNode","_renderSlot","_createVNode","ScalarSidebarButton","ScalarSidebarIndent","ScalarSidebarGroupToggleSpacer","ScalarSidebarGroupToggle","ScalarSidebarGroupToggleButton","_createTextVNode","_toDisplayString","_createElementBlock","ScalarSidebarLoading"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Group component\n *\n * A collapsible ScalarSidebarItem that can contain subitems.\n *\n * Classes applied to the component are passed to the inner list element.\n * Other attributes (like click event) are passed to the toggle button.\n *\n * @example\n * <ScalarSidebarGroup>\n * <!-- Group toggle text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarGroup>\n *\n *\n * By default the component has it's own internal open state, but this can be\n * controlled by passing the `controlled` prop and using binding the :open prop.\n *\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarGroupToggle from './ScalarSidebarGroupToggle.vue'\nimport ScalarSidebarGroupToggleButton from './ScalarSidebarGroupToggleButton.vue'\nimport ScalarSidebarGroupToggleSpacer from './ScalarSidebarGroupToggleSpacer.vue'\nimport ScalarSidebarIndent from './ScalarSidebarIndent.vue'\nimport ScalarSidebarLoading from './ScalarSidebarLoading.vue'\nimport type { ScalarSidebarGroupProps, ScalarSidebarGroupSlots } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst {\n controlled,\n discrete,\n is = 'li',\n} = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the group label is clicked */\n (e: 'click', event: MouseEvent): void\n /**\n * Emitted when _only_ the group toggle button (caret) is clicked\n *\n * Note: This is only emitted if the group is discrete\n */\n (e: 'toggle', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\n\ndefineSlots<ScalarSidebarGroupSlots>()\n\nconst { level } = useSidebarGroups({ increment: true })\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\n/** Handle the click event for the group toggle */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled && !discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n\n/** Handle the click event for the group toggle */\nconst handleToggle = (event: MouseEvent) => {\n // Bubble up the toggle event\n emit('toggle', event)\n if (!controlled && discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n</script>\n<template>\n <component\n v-bind=\"cx('group/item flex flex-col gap-px')\"\n :is=\"is\">\n <div class=\"group/group-button relative flex flex-col text-base\">\n <slot\n name=\"before\"\n :open />\n <slot\n :level=\"level\"\n name=\"button\"\n :open>\n <ScalarSidebarButton\n is=\"button\"\n :active\n :aria-expanded=\"discrete ? undefined : open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n @click=\"handleClick\">\n <template #indent>\n <ScalarSidebarIndent\n class=\"-my-2 mr-0\"\n :indent=\"level\"\n :selected />\n </template>\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot\n name=\"icon\"\n :open />\n </template>\n <template #aside>\n <slot\n name=\"aside\"\n :open />\n <ScalarSidebarGroupToggleSpacer v-if=\"discrete\" />\n <slot\n v-else\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle\n class=\"text-sidebar-c-2\"\n :open />\n </slot>\n </template>\n <slot :open />\n </ScalarSidebarButton>\n <ScalarSidebarGroupToggleButton\n v-if=\"discrete\"\n :open\n :selected\n @click=\"handleToggle\">\n <slot\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle :open>\n <template #label>\n {{ open ? 'Close' : 'Open' }} <slot :open=\"open\" />\n </template>\n </ScalarSidebarGroupToggle>\n </slot>\n </ScalarSidebarGroupToggleButton>\n </slot>\n <slot\n name=\"after\"\n :open />\n </div>\n <ul\n v-if=\"open\"\n class=\"group/items flex flex-col gap-px\">\n <ScalarSidebarLoading v-if=\"loading\" />\n <slot\n v-else\n name=\"items\"\n :open />\n </ul>\n </component>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarGroup.vue_vue_type_script_setup_true_lang.js","names":["$slots","_useModel","_openBlock","_createBlock","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_unref","_withCtx","_createElementVNode","_renderSlot","_createVNode","ScalarSidebarButton","ScalarSidebarIndent","ScalarSidebarGroupToggleSpacer","ScalarSidebarGroupToggle","ScalarSidebarGroupToggleButton","_createTextVNode","_toDisplayString","_createElementBlock","ScalarSidebarLoading"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Group component\n *\n * A collapsible ScalarSidebarItem that can contain subitems.\n *\n * Classes applied to the component are passed to the inner list element.\n * Other attributes (like click event) are passed to the toggle button.\n *\n * @example\n * <ScalarSidebarGroup>\n * <!-- Group toggle text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarGroup>\n *\n *\n * By default the component has it's own internal open state, but this can be\n * controlled by passing the `controlled` prop and using binding the :open prop.\n *\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarGroupToggle from './ScalarSidebarGroupToggle.vue'\nimport ScalarSidebarGroupToggleButton from './ScalarSidebarGroupToggleButton.vue'\nimport ScalarSidebarGroupToggleSpacer from './ScalarSidebarGroupToggleSpacer.vue'\nimport ScalarSidebarIndent from './ScalarSidebarIndent.vue'\nimport ScalarSidebarLoading from './ScalarSidebarLoading.vue'\nimport type { ScalarSidebarGroupProps, ScalarSidebarGroupSlots } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst {\n controlled,\n discrete,\n is = 'li',\n} = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the group label is clicked */\n (e: 'click', event: MouseEvent): void\n /**\n * Emitted when _only_ the group toggle button (caret) is clicked\n *\n * Note: This is only emitted if the group is discrete\n */\n (e: 'toggle', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\n\ndefineSlots<ScalarSidebarGroupSlots>()\n\nconst { level } = useSidebarGroups({ increment: true })\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\n/** Handle the click event for the group toggle */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled && !discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n\n/** Handle the click event for the group toggle */\nconst handleToggle = (event: MouseEvent) => {\n // Bubble up the toggle event\n emit('toggle', event)\n if (!controlled && discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n</script>\n<template>\n <component\n v-bind=\"cx('group/item flex flex-col gap-px')\"\n :is=\"is\">\n <div class=\"group/group-button relative flex flex-col text-base\">\n <slot\n name=\"before\"\n :open />\n <slot\n :level=\"level\"\n name=\"button\"\n :open>\n <ScalarSidebarButton\n is=\"button\"\n :active\n :aria-expanded=\"discrete ? undefined : open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n @click=\"handleClick\">\n <template #indent>\n <ScalarSidebarIndent\n class=\"-my-2 mr-0\"\n :indent=\"level\"\n :selected />\n </template>\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot\n name=\"icon\"\n :open />\n </template>\n <template #aside>\n <slot\n name=\"aside\"\n :open />\n <ScalarSidebarGroupToggleSpacer v-if=\"discrete\" />\n <slot\n v-else\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle\n class=\"text-sidebar-c-2\"\n :open />\n </slot>\n </template>\n <slot :open />\n </ScalarSidebarButton>\n <ScalarSidebarGroupToggleButton\n v-if=\"discrete\"\n :open\n :selected\n @click=\"handleToggle\">\n <slot\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle :open>\n <template #label>\n {{ open ? 'Close' : 'Open' }} <slot :open=\"open\" />\n </template>\n </ScalarSidebarGroupToggle>\n </slot>\n </ScalarSidebarGroupToggleButton>\n </slot>\n <slot\n name=\"after\"\n :open />\n </div>\n <ul\n v-if=\"open\"\n class=\"group/items flex flex-col gap-px\">\n <ScalarSidebarLoading v-if=\"loading\" />\n <slot\n v-else\n name=\"items\"\n :open />\n </ul>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CA,MAAM,OAAO;EAWb,MAAM,OAAOC,SAAoB,SAAC,MAA0B;EAI5D,MAAM,EAAE,UAAU,iBAAiB,EAAE,WAAW,KAAK,CAAC;EAGtD,MAAM,EAAE,OAAO,UAAU;;EAGzB,MAAM,eAAe,UAAsB;GAEzC,KAAK,SAAS,KAAK;GACnB,IAAI,CAAC,QAAA,cAAc,CAAC,QAAA,UAElB,KAAK,QAAQ,CAAC,KAAK;EAEvB;;EAGA,MAAM,gBAAgB,UAAsB;GAE1C,KAAK,UAAU,KAAK;GACpB,IAAI,CAAC,QAAA,cAAc,QAAA,UAEjB,KAAK,QAAQ,CAAC,KAAK;EAEvB;;GAGE,OAAAC,UAAA,GAAAC,YA8EYC,wBA5EL,QAAA,EAAE,GAAAC,eAAAC,mBADCC,MAAA,EAAA,CAAE,CAAA,iCAAA,CAAA,CAAA,GAAA;IAEV,SAAAC,cAiEM,CAjENC,mBAiEM,OAjEN,YAiEM;KAhEJC,WAEU,KAAA,QAAA,UAAA,EAAP,MAAA,KAAA,MAAI,CAAA;KACPA,WAyDO,KAAA,QAAA,UAAA;MAxDJ,OAAOH,MAAA,KAAA;MAEP,MAAA,KAAA;KAHH,SAyDO,CArDLI,YAqCsBC,6BAAA;MApCpB,IAAG;MACF,QAAA,QAAA;MACA,iBAAe,QAAA,WAAW,KAAA,IAAY,KAAA;MACtC,UAAA,QAAA;MACA,MAAA,QAAA;MACA,QAAQL,MAAA,KAAA;MACR,UAAA,QAAA;MACA,SAAO;;MACG,QAAMC,cAID,CAHdG,YAGcE,6BAAA;OAFZ,OAAM;OACL,QAAQN,MAAA,KAAA;OACR,UAAA,QAAA;;MASM,OAAKC,cAGJ,CAFVE,WAEU,KAAA,QAAA,SAAA,EAAP,MAAA,KAAA,MAAI,CAAA,GAC+B,QAAA,YAAtCR,UAAA,GAAAC,YAAkDW,wCAAA,EAAA,KAAA,EAAA,CAAA,KAClDJ,WAOO,KAAA,QAAA,UAAA,EAJJ,MAAA,KAAA,MAAI,SAIA,CAHLC,YAEUI,kCAAA;OADR,OAAM;OACL,MAAA,KAAA;;MAGP,SAAAP,cAAc,CAAdE,WAAc,KAAA,QAAA,WAAA,EAAP,MAAA,KAAA,MAAI,CAAA,C;;K,IApBHV,KAAAA,OAAO,O;MACZ,MAAA;MACD,IAAAQ,cAEU,CAFVE,WAEU,KAAA,QAAA,QAAA,EAAP,MAAA,KAAA,MAAI,CAAA,C;;;;;;;;;K,IAmBH,QAAA,YADRR,UAAA,GAAAC,YAciCa,wCAAA;;MAZ9B,MAAA,KAAA;MACA,UAAA,QAAA;MACA,SAAO;;MACR,SAAAR,cAQO,CARPE,WAQO,KAAA,QAAA,UAAA,EANJ,MAAA,KAAA,MAAI,SAMA,CALLC,YAI2BI,kCAAA,EAJA,MAAA,KAAA,MAAI,GAAA;OAClB,OAAKP,cACe,CAA1BS,gBAAAC,gBAAA,KAAA,QAAI,UAAA,MAAA,IAAsB,KAAC,CAAA,GAAAR,WAAqB,KAAA,QAAA,WAAA,EAAd,MAAM,KAAA,MAAI,CAAA,C;;;;;KAMzDA,WAEU,KAAA,QAAA,SAAA,EAAP,MAAA,KAAA,MAAI,CAAA;I,IAGD,KAAA,SADRR,UAAA,GAAAiB,mBAQK,MARL,YAQK,CALyB,QAAA,WAA5BjB,UAAA,GAAAC,YAAuCiB,8BAAA,EAAA,KAAA,EAAA,CAAA,KACvCV,WAGU,KAAA,QAAA,SAAA,EAAP,MAAA,KAAA,MAAI,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA,C"}
|
|
@@ -8,7 +8,14 @@ var ScalarSidebarGroupToggle_vue_vue_type_script_setup_true_lang_default = /*@__
|
|
|
8
8
|
inheritAttrs: false,
|
|
9
9
|
__name: "ScalarSidebarGroupToggle",
|
|
10
10
|
props: {
|
|
11
|
-
is: {
|
|
11
|
+
is: {
|
|
12
|
+
type: [
|
|
13
|
+
Object,
|
|
14
|
+
Function,
|
|
15
|
+
String
|
|
16
|
+
],
|
|
17
|
+
default: "div"
|
|
18
|
+
},
|
|
12
19
|
open: {
|
|
13
20
|
type: Boolean,
|
|
14
21
|
default: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarGroupToggle.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_withCtx","_renderSlot","ScalarIconLegacyAdapter","_createElementVNode","_createTextVNode","_toDisplayString"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroupToggle.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Group toggle component\n *\n * Provides the toggle icon for a ScalarSidebarGroup\n *\n * @example\n * <ScalarSidebarGroupToggle :open=\"...\" />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconCaretRight } from '@scalar/icons'\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { cva, useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nimport { ScalarIconLegacyAdapter, type Icon } from '../ScalarIcon'\n\nconst { is = 'div', open = false } = defineProps<{\n /** Override the element tag */\n is?: Component | string\n /** Whether or not the toggle is open */\n open?: boolean\n /** Overrides the icon */\n icon?: Icon | ScalarIconComponent\n}>()\n\ndefineSlots<{\n /** Override the toggle icon */\n default?(props: { open: boolean }): unknown\n /** Override the screen reader label */\n label?(props: { open: boolean }): unknown\n}>()\n\nconst variants = cva({\n base: 'size-4 flex items-center justify-center transition-transform duration-100',\n variants: { open: { true: 'rotate-90' } },\n defaultVariants: { open: false },\n})\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n :type=\"is === 'button' ? 'button' : undefined\"\n v-bind=\"cx(variants({ open }))\">\n <slot :open=\"open\">\n <ScalarIconLegacyAdapter\n v-if=\"icon\"\n :icon=\"icon\" />\n <ScalarIconCaretRight\n v-else\n class=\"size-3\"\n weight=\"bold\" />\n </slot>\n <span class=\"sr-only\">\n <slot\n name=\"label\"\n :open=\"open\">\n {{ open ? 'Close' : 'Open' }} Group\n </slot>\n </span>\n </component>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarGroupToggle.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_withCtx","_renderSlot","ScalarIconLegacyAdapter","_createElementVNode","_createTextVNode","_toDisplayString"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroupToggle.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Group toggle component\n *\n * Provides the toggle icon for a ScalarSidebarGroup\n *\n * @example\n * <ScalarSidebarGroupToggle :open=\"...\" />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconCaretRight } from '@scalar/icons'\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { cva, useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nimport { ScalarIconLegacyAdapter, type Icon } from '../ScalarIcon'\n\nconst { is = 'div', open = false } = defineProps<{\n /** Override the element tag */\n is?: Component | string\n /** Whether or not the toggle is open */\n open?: boolean\n /** Overrides the icon */\n icon?: Icon | ScalarIconComponent\n}>()\n\ndefineSlots<{\n /** Override the toggle icon */\n default?(props: { open: boolean }): unknown\n /** Override the screen reader label */\n label?(props: { open: boolean }): unknown\n}>()\n\nconst variants = cva({\n base: 'size-4 flex items-center justify-center transition-transform duration-100',\n variants: { open: { true: 'rotate-90' } },\n defaultVariants: { open: false },\n})\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n :type=\"is === 'button' ? 'button' : undefined\"\n v-bind=\"cx(variants({ open }))\">\n <slot :open=\"open\">\n <ScalarIconLegacyAdapter\n v-if=\"icon\"\n :icon=\"icon\" />\n <ScalarIconCaretRight\n v-else\n class=\"size-3\"\n weight=\"bold\" />\n </slot>\n <span class=\"sr-only\">\n <slot\n name=\"label\"\n :open=\"open\">\n {{ open ? 'Close' : 'Open' }} Group\n </slot>\n </span>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAmCA,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EAAE,MAAM,EAAE,MAAM,YAAY,EAAE;GACxC,iBAAiB,EAAE,MAAM,MAAM;EACjC,CAAC;EAED,MAAM,EAAE,OAAO,UAAU;;GAGvB,OAAAA,UAAA,GAAAC,YAoBYC,wBAnBL,QAAA,EAAE,GADTC,WAoBY,EAlBT,MAAM,QAAA,OAAE,WAAA,WAA2B,KAAA,EAC5B,GAAAC,MAAA,EAAA,CAAE,CAACA,MAAA,QAAA,CAAQ,CAAA,EAAA,MAAG,QAAA,KAAI,CAAA,CAAA,CAAA,GAAA;IAC1B,SAAAC,cAQO,CARPC,WAQO,KAAA,QAAA,WAAA,EARA,MAAM,QAAA,KAAI,SAQV,CANG,QAAA,QADRN,UAAA,GAAAC,YAEiBG,MAAAG,+BAAA,GAAA;;KAAd,MAAM,QAAA;I,0BACTP,UAAA,GAAAC,YAGkBG,MAAA,oBAAA,GAAA;;KADhB,OAAM;KACN,QAAO;I,OAEXI,mBAMO,QANP,YAMO,CALLF,WAIO,KAAA,QAAA,SAAA,EAFJ,MAAM,QAAA,KAAI,SAEN,CADFG,gBAAAC,gBAAA,QAAA,OAAI,UAAA,MAAA,IAAsB,WAC/B,CAAA,C"}
|
package/dist/components/ScalarSidebar/ScalarSidebarItem.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -6,7 +6,11 @@ var ScalarSidebarItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
6
6
|
inheritAttrs: false,
|
|
7
7
|
__name: "ScalarSidebarItem",
|
|
8
8
|
props: {
|
|
9
|
-
is: {
|
|
9
|
+
is: { type: [
|
|
10
|
+
Object,
|
|
11
|
+
Function,
|
|
12
|
+
String
|
|
13
|
+
] },
|
|
10
14
|
icon: { type: [Object, Function] },
|
|
11
15
|
active: { type: Boolean },
|
|
12
16
|
selected: { type: Boolean },
|
package/dist/components/ScalarSidebar/ScalarSidebarItem.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarItem.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_renderSlot","_createVNode","ScalarSidebarButton","_mergeProps","_withCtx"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarItem.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Item component\n *\n * Provides a ScalarSidebarButton wrapped in an `<li>` to\n * meet accessibility requirements and automatically indents\n * the button based on the level of the sidebar group\n *\n * @example\n * <ScalarSidebarItem>\n * <template #icon>\n * <!-- Overrides the icon slot -->\n * </template>\n * <!-- Button text -->\n * <template #aside>\n * <!-- After the button text -->\n * </template>\n * <!-- Content to display before the button but inside the list item -->\n * <template #before>\n * <!-- Before the button -->\n * </template>\n * <!-- Content to display after the button but inside the list item -->\n * <template #after>\n * <!-- After the button -->\n * </template>\n * </ScalarSidebarItem>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport type { ScalarSidebarItemProps, ScalarSidebarItemSlots } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst props = defineProps<ScalarSidebarItemProps>()\n\ndefineSlots<ScalarSidebarItemSlots>()\n\nconst { level } = useSidebarGroups()\n\nconst { cx } = useBindCx()\ndefineOptions({ inheritAttrs: false })\n</script>\n<template>\n <li v-bind=\"cx('group/item flex flex-col text-base')\">\n <slot name=\"before\" />\n <slot\n :level=\"level\"\n name=\"button\">\n <ScalarSidebarButton\n v-bind=\"props\"\n :indent=\"indent ?? level\">\n <!-- Pass through all the slots -->\n <template\n v-if=\"$slots.default\"\n #default>\n <slot />\n </template>\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot name=\"icon\" />\n </template>\n <template\n v-if=\"$slots.aside\"\n #aside>\n <slot name=\"aside\" />\n </template>\n </ScalarSidebarButton>\n </slot>\n <slot name=\"after\" />\n </li>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarItem.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_unref","_renderSlot","_createVNode","ScalarSidebarButton","_mergeProps","_withCtx"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarItem.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Item component\n *\n * Provides a ScalarSidebarButton wrapped in an `<li>` to\n * meet accessibility requirements and automatically indents\n * the button based on the level of the sidebar group\n *\n * @example\n * <ScalarSidebarItem>\n * <template #icon>\n * <!-- Overrides the icon slot -->\n * </template>\n * <!-- Button text -->\n * <template #aside>\n * <!-- After the button text -->\n * </template>\n * <!-- Content to display before the button but inside the list item -->\n * <template #before>\n * <!-- Before the button -->\n * </template>\n * <!-- Content to display after the button but inside the list item -->\n * <template #after>\n * <!-- After the button -->\n * </template>\n * </ScalarSidebarItem>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport type { ScalarSidebarItemProps, ScalarSidebarItemSlots } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst props = defineProps<ScalarSidebarItemProps>()\n\ndefineSlots<ScalarSidebarItemSlots>()\n\nconst { level } = useSidebarGroups()\n\nconst { cx } = useBindCx()\ndefineOptions({ inheritAttrs: false })\n</script>\n<template>\n <li v-bind=\"cx('group/item flex flex-col text-base')\">\n <slot name=\"before\" />\n <slot\n :level=\"level\"\n name=\"button\">\n <ScalarSidebarButton\n v-bind=\"props\"\n :indent=\"indent ?? level\">\n <!-- Pass through all the slots -->\n <template\n v-if=\"$slots.default\"\n #default>\n <slot />\n </template>\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot name=\"icon\" />\n </template>\n <template\n v-if=\"$slots.aside\"\n #aside>\n <slot name=\"aside\" />\n </template>\n </ScalarSidebarButton>\n </slot>\n <slot name=\"after\" />\n </li>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAoCA,MAAM,QAAQ;EAId,MAAM,EAAE,UAAU,iBAAiB;EAEnC,MAAM,EAAE,OAAO,UAAU;;GAIvB,OAAAC,UAAA,GAAAC,mBA2BK,MAAAC,eAAAC,mBA3BOC,MAAA,EAAA,CAAE,CAAA,oCAAA,CAAA,CAAA,GAAA;IACZC,WAAsB,KAAA,QAAA,QAAA;IACtBA,WAuBO,KAAA,QAAA,UAAA,EAtBJ,OAAOD,MAAA,KAAA,EAAK,SAsBR,CApBLE,YAmBsBC,6BAnBtBC,WACU,OAAK,EACZ,QAAQ,QAAA,UAAUJ,MAAA,KAAA,E;KAGXL,KAAAA,OAAO,U;MACZ,MAAA;MACD,IAAAU,cAAQ,CAARJ,WAAQ,KAAA,QAAA,SAAA,C;;;KAGFN,KAAAA,OAAO,O;MACZ,MAAA;MACD,IAAAU,cAAoB,CAApBJ,WAAoB,KAAA,QAAA,MAAA,C;;;KAGdN,KAAAA,OAAO,Q;MACZ,MAAA;MACD,IAAAU,cAAqB,CAArBJ,WAAqB,KAAA,QAAA,OAAA,C;;;;IAI3BA,WAAqB,KAAA,QAAA,OAAA"}
|
package/dist/components/ScalarSidebar/ScalarSidebarItems.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -4,7 +4,14 @@ import { createBlock, defineComponent, guardReactiveProps, normalizeProps, openB
|
|
|
4
4
|
var ScalarSidebarItems_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
5
|
inheritAttrs: false,
|
|
6
6
|
__name: "ScalarSidebarItems",
|
|
7
|
-
props: { is: {
|
|
7
|
+
props: { is: {
|
|
8
|
+
type: [
|
|
9
|
+
Object,
|
|
10
|
+
Function,
|
|
11
|
+
String
|
|
12
|
+
],
|
|
13
|
+
default: "ul"
|
|
14
|
+
} },
|
|
8
15
|
setup(__props) {
|
|
9
16
|
const { open } = useSidebarNestedItems();
|
|
10
17
|
const { cx } = useBindCx();
|
package/dist/components/ScalarSidebar/ScalarSidebarItems.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarItems.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_unref","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarItems.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Items component\n *\n * A base container for ScalarSidebarItem(s), renders as\n * a `<ul>` by default to meet accessibility requirements\n *\n * @example\n * <ScalarSidebarItems>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </ScalarSidebarItems>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nimport { useSidebarNestedItems } from './useSidebarNestedItems'\n\nconst { is = 'ul' } = defineProps<{\n is?: Component | string\n}>()\n\nconst { open } = useSidebarNestedItems()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"\n cx(\n 'group/items relative flex flex-col p-(--scalar-sidebar-padding) gap-px transition-transform duration-300',\n open ? '-translate-x-full' : 'translate-x-0',\n )\n \">\n <slot />\n </component>\n</template>\n<style>\n@reference \"../../style.css\";\n\n/* Hide the buttons from the keyboard when a nested item is open */\n.group\\/items.-translate-x-full .group\\/button {\n /* Required to prevent the button from being focused */\n display: none;\n /* Required to prevent the button from taking up scroll space */\n max-height: 0;\n\n transition-property: display, max-height;\n transition-behavior: allow-discrete;\n transition-duration: 0s;\n transition-delay: 300ms;\n}\n\n/* Show the buttons within a nested item when it is open */\n.group\\/item.group\\/nested-items-open\n > *\n > .group\\/items.translate-x-0\n .group\\/button {\n max-height: calc(infinity * 1px);\n display: flex;\n}\n</style>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarItems.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeProps","_guardReactiveProps","_unref","_withCtx","_renderSlot"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarItems.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Items component\n *\n * A base container for ScalarSidebarItem(s), renders as\n * a `<ul>` by default to meet accessibility requirements\n *\n * @example\n * <ScalarSidebarItems>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </ScalarSidebarItems>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport type { Component } from 'vue'\n\nimport { useSidebarNestedItems } from './useSidebarNestedItems'\n\nconst { is = 'ul' } = defineProps<{\n is?: Component | string\n}>()\n\nconst { open } = useSidebarNestedItems()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"\n cx(\n 'group/items relative flex flex-col p-(--scalar-sidebar-padding) gap-px transition-transform duration-300',\n open ? '-translate-x-full' : 'translate-x-0',\n )\n \">\n <slot />\n </component>\n</template>\n<style>\n@reference \"../../style.css\";\n\n/* Hide the buttons from the keyboard when a nested item is open */\n.group\\/items.-translate-x-full .group\\/button {\n /* Required to prevent the button from being focused */\n display: none;\n /* Required to prevent the button from taking up scroll space */\n max-height: 0;\n\n transition-property: display, max-height;\n transition-behavior: allow-discrete;\n transition-duration: 0s;\n transition-delay: 300ms;\n}\n\n/* Show the buttons within a nested item when it is open */\n.group\\/item.group\\/nested-items-open\n > *\n > .group\\/items.translate-x-0\n .group\\/button {\n max-height: calc(infinity * 1px);\n display: flex;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;EA0BA,MAAM,EAAE,SAAS,sBAAsB;EAGvC,MAAM,EAAE,OAAO,UAAU;;GAGvB,OAAAA,UAAA,GAAAC,YASYC,wBARL,QAAA,EAAE,GAAAC,eAAAC,mBACQC,MAAA,EAAA,CAAE,C,4GAA8HA,MAAA,IAAA,IAAI,sBAAA,e;IAMnJ,SAAAC,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -17,7 +17,11 @@ var ScalarSidebarNestedItems_vue_vue_type_script_setup_true_lang_default = /*@__
|
|
|
17
17
|
inheritAttrs: false,
|
|
18
18
|
__name: "ScalarSidebarNestedItems",
|
|
19
19
|
props: /*@__PURE__*/ mergeModels({
|
|
20
|
-
is: {
|
|
20
|
+
is: { type: [
|
|
21
|
+
Object,
|
|
22
|
+
Function,
|
|
23
|
+
String
|
|
24
|
+
] },
|
|
21
25
|
icon: { type: [Object, Function] },
|
|
22
26
|
active: { type: Boolean },
|
|
23
27
|
selected: { type: Boolean },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarNestedItems.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots","_useModel","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_renderSlot","_createVNode","ScalarSidebarButton","_mergeProps","_unref","_createSlots","_withCtx","_Transition","ScalarSidebarItems","_normalizeProps","_guardReactiveProps","_createElementVNode","_createTextVNode","ScalarSidebarSpacer","_createBlock","ScalarSidebarLoading"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Nested Items component\n *\n * A provides list of items thats presented over the parent list\n * Needs to be nested inside a ScalarSidebarItems component\n *\n * @example\n * <ScalarSidebarNestedItems v-model=\"open\">\n * <!-- Item text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarNestedItems>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconArrowRight, ScalarIconCaretLeft } from '@scalar/icons'\nimport { nextTick, ref, useTemplateRef } from 'vue'\n\nimport { findScrollContainer } from './findScrollContainer'\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarItems from './ScalarSidebarItems.vue'\nimport ScalarSidebarLoading from './ScalarSidebarLoading.vue'\nimport ScalarSidebarSpacer from './ScalarSidebarSpacer.vue'\nimport type { ScalarSidebarGroupProps } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\nimport { useSidebarNestedItem } from './useSidebarNestedItems'\n\nconst { controlled } = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the nested item button is clicked */\n (e: 'click', event: MouseEvent): void\n /** Emitted when the back button is clicked */\n (e: 'back', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\nuseSidebarNestedItem(() => open.value)\n\ndefineSlots<{\n /** The text content of the button */\n 'default'?: () => unknown\n /** Override the entire button */\n 'button'?: () => unknown\n /** Override the icon */\n 'icon'?: () => unknown\n /** Override the aside slot */\n 'aside'?: () => unknown\n /** Override the back button */\n 'back'?: () => unknown\n /** Override the back button label */\n 'back-label'?: () => unknown\n /** The list of sidebar subitems */\n 'items'?: () => unknown\n}>()\n\nconst { level } = useSidebarGroups({ reset: true })\n\n/** The root element ref */\nconst el = useTemplateRef('el')\n\n/** How far down to offset the nested items by when animating them in */\nconst offset = ref(0)\n\n// Transition hooks\n\nfunction onOpen() {\n // Calculate how far down the nearest scroll container is scrolled\n // We offset the nested items by this amount when animating them\n // in so they appear in line with the parent items list.\n offset.value = findScrollContainer(el.value).scrollTop ?? 0\n\n // Focus the first button in the nested items\n nextTick(() =>\n el.value\n ?.querySelector<HTMLButtonElement>('button:not([aria-expanded=\"true\"])')\n ?.focus({ preventScroll: true }),\n )\n}\nfunction onOpened() {\n /** Reset the scroll position of the scroll container after opening */\n findScrollContainer(el.value).scrollTop = 0\n}\nfunction onClose() {\n nextTick(() => {\n el.value?.querySelector('button')?.focus({ preventScroll: true })\n findScrollContainer(el.value).scrollTop = offset.value\n })\n}\n\ndefineOptions({ inheritAttrs: false })\n\n/** Handle the click event for the nested items button */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = true\n }\n}\n\n/** Handle the back button click event */\nconst handleBack = (event: MouseEvent) => {\n // Bubble up the back event\n emit('back', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = false\n }\n}\n</script>\n<template>\n <li\n ref=\"el\"\n class=\"group/item group/nested-items contents\"\n :class=\"{ 'group/nested-items-open': open }\"\n :style=\"{ '--nested-items-offset': `${offset}px` }\">\n <slot name=\"button\">\n <ScalarSidebarButton\n is=\"button\"\n :aria-expanded=\"open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n v-bind=\"$attrs\"\n @click=\"handleClick\">\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot name=\"icon\" />\n </template>\n <slot />\n <template #aside>\n <slot name=\"aside\">\n <ScalarIconArrowRight class=\"text-sidebar-c-2 size-4\" />\n </slot>\n </template>\n </ScalarSidebarButton>\n </slot>\n <!-- Make sure the div is around for the entire transition -->\n <Transition\n :duration=\"300\"\n enterActiveClass=\"top-(--nested-items-offset)!\"\n leaveActiveClass=\"top-(--nested-items-offset)!\"\n @afterEnter=\"onOpened\"\n @enter=\"onOpen\"\n @leave=\"onClose\">\n <div\n v-if=\"open\"\n class=\"absolute inset-0 translate-x-full\">\n <ScalarSidebarItems v-bind=\"$attrs\">\n <div\n class=\"bg-sidebar-b-1 animate-sidebar-border-bottom border-b-sidebar-border sticky top-(--scalar-sidebar-sticky-offset,0) z-1 -mx-(--scalar-sidebar-padding) -mt-(--scalar-sidebar-padding) flex flex-col gap-px px-(--scalar-sidebar-padding) pt-(--scalar-sidebar-padding)\">\n <slot name=\"back\">\n <ScalarSidebarButton\n is=\"button\"\n class=\"text-sidebar-c-1 font-sidebar-active hover:text-sidebar-c-1\"\n @click=\"handleBack\">\n <template #icon>\n <ScalarIconCaretLeft class=\"text-sidebar-c-2 -m-px size-4\" />\n </template>\n <slot name=\"back-label\">Back</slot>\n </ScalarSidebarButton>\n </slot>\n <ScalarSidebarSpacer class=\"h-3\" />\n </div>\n <ScalarSidebarLoading v-if=\"loading\" />\n <slot\n v-else\n name=\"items\" />\n </ScalarSidebarItems>\n </div>\n </Transition>\n </li>\n</template>\n\n<style>\n@reference \"../../style.css\";\n\n.animate-sidebar-border-bottom {\n animation: border-bottom forwards;\n animation-timeline: scroll();\n animation-range-end: 1px;\n}\n\n@keyframes border-bottom {\n from {\n border-bottom-width: 0;\n }\n to {\n border-bottom-width: var(--scalar-border-width);\n }\n}\n</style>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarNestedItems.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots","_useModel","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_renderSlot","_createVNode","ScalarSidebarButton","_mergeProps","_unref","_createSlots","_withCtx","_Transition","ScalarSidebarItems","_normalizeProps","_guardReactiveProps","_createElementVNode","_createTextVNode","ScalarSidebarSpacer","_createBlock","ScalarSidebarLoading"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Nested Items component\n *\n * A provides list of items thats presented over the parent list\n * Needs to be nested inside a ScalarSidebarItems component\n *\n * @example\n * <ScalarSidebarNestedItems v-model=\"open\">\n * <!-- Item text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarNestedItems>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconArrowRight, ScalarIconCaretLeft } from '@scalar/icons'\nimport { nextTick, ref, useTemplateRef } from 'vue'\n\nimport { findScrollContainer } from './findScrollContainer'\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarItems from './ScalarSidebarItems.vue'\nimport ScalarSidebarLoading from './ScalarSidebarLoading.vue'\nimport ScalarSidebarSpacer from './ScalarSidebarSpacer.vue'\nimport type { ScalarSidebarGroupProps } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\nimport { useSidebarNestedItem } from './useSidebarNestedItems'\n\nconst { controlled } = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the nested item button is clicked */\n (e: 'click', event: MouseEvent): void\n /** Emitted when the back button is clicked */\n (e: 'back', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\nuseSidebarNestedItem(() => open.value)\n\ndefineSlots<{\n /** The text content of the button */\n 'default'?: () => unknown\n /** Override the entire button */\n 'button'?: () => unknown\n /** Override the icon */\n 'icon'?: () => unknown\n /** Override the aside slot */\n 'aside'?: () => unknown\n /** Override the back button */\n 'back'?: () => unknown\n /** Override the back button label */\n 'back-label'?: () => unknown\n /** The list of sidebar subitems */\n 'items'?: () => unknown\n}>()\n\nconst { level } = useSidebarGroups({ reset: true })\n\n/** The root element ref */\nconst el = useTemplateRef('el')\n\n/** How far down to offset the nested items by when animating them in */\nconst offset = ref(0)\n\n// Transition hooks\n\nfunction onOpen() {\n // Calculate how far down the nearest scroll container is scrolled\n // We offset the nested items by this amount when animating them\n // in so they appear in line with the parent items list.\n offset.value = findScrollContainer(el.value).scrollTop ?? 0\n\n // Focus the first button in the nested items\n nextTick(() =>\n el.value\n ?.querySelector<HTMLButtonElement>('button:not([aria-expanded=\"true\"])')\n ?.focus({ preventScroll: true }),\n )\n}\nfunction onOpened() {\n /** Reset the scroll position of the scroll container after opening */\n findScrollContainer(el.value).scrollTop = 0\n}\nfunction onClose() {\n nextTick(() => {\n el.value?.querySelector('button')?.focus({ preventScroll: true })\n findScrollContainer(el.value).scrollTop = offset.value\n })\n}\n\ndefineOptions({ inheritAttrs: false })\n\n/** Handle the click event for the nested items button */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = true\n }\n}\n\n/** Handle the back button click event */\nconst handleBack = (event: MouseEvent) => {\n // Bubble up the back event\n emit('back', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = false\n }\n}\n</script>\n<template>\n <li\n ref=\"el\"\n class=\"group/item group/nested-items contents\"\n :class=\"{ 'group/nested-items-open': open }\"\n :style=\"{ '--nested-items-offset': `${offset}px` }\">\n <slot name=\"button\">\n <ScalarSidebarButton\n is=\"button\"\n :aria-expanded=\"open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n v-bind=\"$attrs\"\n @click=\"handleClick\">\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot name=\"icon\" />\n </template>\n <slot />\n <template #aside>\n <slot name=\"aside\">\n <ScalarIconArrowRight class=\"text-sidebar-c-2 size-4\" />\n </slot>\n </template>\n </ScalarSidebarButton>\n </slot>\n <!-- Make sure the div is around for the entire transition -->\n <Transition\n :duration=\"300\"\n enterActiveClass=\"top-(--nested-items-offset)!\"\n leaveActiveClass=\"top-(--nested-items-offset)!\"\n @afterEnter=\"onOpened\"\n @enter=\"onOpen\"\n @leave=\"onClose\">\n <div\n v-if=\"open\"\n class=\"absolute inset-0 translate-x-full\">\n <ScalarSidebarItems v-bind=\"$attrs\">\n <div\n class=\"bg-sidebar-b-1 animate-sidebar-border-bottom border-b-sidebar-border sticky top-(--scalar-sidebar-sticky-offset,0) z-1 -mx-(--scalar-sidebar-padding) -mt-(--scalar-sidebar-padding) flex flex-col gap-px px-(--scalar-sidebar-padding) pt-(--scalar-sidebar-padding)\">\n <slot name=\"back\">\n <ScalarSidebarButton\n is=\"button\"\n class=\"text-sidebar-c-1 font-sidebar-active hover:text-sidebar-c-1\"\n @click=\"handleBack\">\n <template #icon>\n <ScalarIconCaretLeft class=\"text-sidebar-c-2 -m-px size-4\" />\n </template>\n <slot name=\"back-label\">Back</slot>\n </ScalarSidebarButton>\n </slot>\n <ScalarSidebarSpacer class=\"h-3\" />\n </div>\n <ScalarSidebarLoading v-if=\"loading\" />\n <slot\n v-else\n name=\"items\" />\n </ScalarSidebarItems>\n </div>\n </Transition>\n </li>\n</template>\n\n<style>\n@reference \"../../style.css\";\n\n.animate-sidebar-border-bottom {\n animation: border-bottom forwards;\n animation-timeline: scroll();\n animation-range-end: 1px;\n}\n\n@keyframes border-bottom {\n from {\n border-bottom-width: 0;\n }\n to {\n border-bottom-width: var(--scalar-border-width);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCA,MAAM,OAAO;EAOb,MAAM,OAAOE,SAAoB,SAAC,MAA0B;EAC5D,2BAA2B,KAAK,KAAK;EAmBrC,MAAM,EAAE,UAAU,iBAAiB,EAAE,OAAO,KAAK,CAAC;;EAGlD,MAAM,KAAK,eAAe,IAAI;;EAG9B,MAAM,SAAS,IAAI,CAAC;EAIpB,SAAS,SAAS;GAIhB,OAAO,QAAQ,oBAAoB,GAAG,KAAK,CAAC,CAAC,aAAa;GAG1D,eACE,GAAG,OACC,cAAiC,sCAAoC,CAAA,EACrE,MAAM,EAAE,eAAe,KAAK,CAAC,CACnC;EACF;EACA,SAAS,WAAW;;GAElB,oBAAoB,GAAG,KAAK,CAAC,CAAC,YAAY;EAC5C;EACA,SAAS,UAAU;GACjB,eAAe;IACb,GAAG,OAAO,cAAc,QAAQ,CAAC,EAAE,MAAM,EAAE,eAAe,KAAK,CAAC;IAChE,oBAAoB,GAAG,KAAK,CAAC,CAAC,YAAY,OAAO;GACnD,CAAC;EACH;;EAKA,MAAM,eAAe,UAAsB;GAEzC,KAAK,SAAS,KAAK;GACnB,IAAI,CAAC,QAAA,YAEH,KAAK,QAAQ;EAEjB;;EAGA,MAAM,cAAc,UAAsB;GAExC,KAAK,QAAQ,KAAK;GAClB,IAAI,CAAC,QAAA,YAEH,KAAK,QAAQ;EAEjB;;GAGE,OAAAC,UAAA,GAAAC,mBA8DK,MAAA;IA7DC,SAAA;IAAJ,KAAI;IACJ,OAAKC,eAAA,CAAC,0CAAwC,EAAA,2BACT,KAAA,MAAI,CAAA,CAAA;IACxC,OAAKC,eAAA,EAAA,yBAAA,GAAgC,OAAA,MAAM,IAAA,CAAA;G,IAC5CC,WAsBO,KAAA,QAAA,UAAA,CAAA,SAAA,CArBLC,YAoBsBC,6BApBtBC,WAoBsB;IAnBpB,IAAG;IACF,iBAAe,KAAA;IACf,UAAA,QAAA;IACA,MAAA,QAAA;IACA,QAAQC,MAAA,KAAA;IACR,UAAA,QAAA;GACOX,GAAAA,KAAAA,QAAM,EACb,SAAO,YAAW,CAAA,GAAAY,YAAA;IAOR,OAAKC,cAGP,CAFPN,WAEO,KAAA,QAAA,SAAA,CAAA,SAAA,CADLC,YAAwDG,MAAA,oBAAA,GAAA,EAAlC,OAAM,0BAAyB,CAAA,C;IAHzD,SAAAE,cAAQ,CAARN,WAAQ,KAAA,QAAA,SAAA,C;;G,IAJAN,KAAAA,OAAO,O;IACZ,MAAA;IACD,IAAAY,cAAoB,CAApBN,WAAoB,KAAA,QAAA,MAAA,C;;;;;;;;G,MAW1BC,YAgCaM,YAAA;IA/BV,UAAU;IACX,kBAAiB;IACjB,kBAAiB;IAChB,cAAY;IACZ,SAAO;IACP,SAAO;;IACR,SAAAD,cAwBM,CAvBE,KAAA,SADRV,UAAA,GAAAC,mBAwBM,OAxBN,YAwBM,CArBJI,YAoBqBO,4BAAAC,eAAAC,mBApBOjB,KAAAA,MAAM,CAAA,GAAA;KAChC,SAAAa,cAcM,CAdNK,mBAcM,OAdN,YAcM,CAZJX,WAUO,KAAA,QAAA,QAAA,CAAA,SAAA,CATLC,YAQsBC,6BAAA;MAPpB,IAAG;MACH,OAAM;MACL,SAAO;;MACG,MAAII,cACgD,CAA7DL,YAA6DG,MAAA,mBAAA,GAAA,EAAxC,OAAM,gCAA+B,CAAA,C;MAE5D,SAAAE,cAAmC,CAAnCN,WAAmC,KAAA,QAAA,cAAA,CAAA,SAAA,CAAX,OAAA,OAAA,OAAA,KAAAY,gBAAA,QAAI,EAAA,E;;K,MAGhCX,YAAmCY,6BAAA,EAAd,OAAM,MAAK,CAAA,C,IAEN,QAAA,WAA5BjB,UAAA,GAAAkB,YAAuCC,8BAAA,EAAA,KAAA,EAAA,CAAA,KACvCf,WAEiB,KAAA,QAAA,SAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA,C"}
|
package/dist/components/ScalarSidebar/ScalarSidebarSection.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -10,7 +10,14 @@ var ScalarSidebarSection_vue_vue_type_script_setup_true_lang_default = /*@__PURE
|
|
|
10
10
|
inheritAttrs: false,
|
|
11
11
|
__name: "ScalarSidebarSection",
|
|
12
12
|
props: {
|
|
13
|
-
is: {
|
|
13
|
+
is: {
|
|
14
|
+
type: [
|
|
15
|
+
Object,
|
|
16
|
+
Function,
|
|
17
|
+
String
|
|
18
|
+
],
|
|
19
|
+
default: "li"
|
|
20
|
+
},
|
|
14
21
|
icon: { type: [Object, Function] },
|
|
15
22
|
active: { type: Boolean },
|
|
16
23
|
selected: { type: Boolean },
|