@scalar/components 0.35.5 → 0.36.1
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/ScalarCard.vue.d.ts.map +1 -1
- package/dist/components/ScalarCard/ScalarCard.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 +137 -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/ScalarModal/ScalarModal.vue.d.ts +0 -2
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts.map +1 -1
- package/dist/components/ScalarModal/ScalarModal.vue.js +1 -1
- package/dist/components/ScalarModal/ScalarModal.vue_vue_type_script_setup_true_lang.js +53 -34
- package/dist/components/ScalarModal/ScalarModal.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/ScalarTeleport/ScalarTeleport.vue.d.ts +2 -1
- package/dist/components/ScalarTeleport/ScalarTeleport.vue.d.ts.map +1 -1
- package/dist/components/ScalarTeleport/ScalarTeleport.vue_vue_type_script_setup_true_lang.js +47 -4
- package/dist/components/ScalarTeleport/ScalarTeleport.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ScalarTooltip/useTooltip.d.ts.map +1 -1
- package/dist/components/ScalarTooltip/useTooltip.js +7 -2
- package/dist/components/ScalarTooltip/useTooltip.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 +87 -38
- package/dist/vue-styles.css +20 -19
- package/package.json +19 -13
|
@@ -27,9 +27,10 @@ export type FloatingOptions = {
|
|
|
27
27
|
* Override the target, useful if we are not passing a button
|
|
28
28
|
* into the slot but is controlled from an external button
|
|
29
29
|
*
|
|
30
|
-
* Can be a string id or a reference to an element
|
|
30
|
+
* Can be a string id or a reference to an element.
|
|
31
|
+
* Keep string explicit so Vue includes it in production prop validation.
|
|
31
32
|
*/
|
|
32
|
-
target?: MaybeRefOrGetter<HTMLElement | string>;
|
|
33
|
+
target?: string | MaybeRefOrGetter<HTMLElement | string>;
|
|
33
34
|
/**
|
|
34
35
|
* Floating UI Middleware to be passed to Floating UI
|
|
35
36
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAE3C,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,gBAAgB,CAAA;IACnC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAE3C,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,gBAAgB,CAAA;IACnC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC,WAAW,GAAG,MAAM,CAAC,CAAA;IACxD;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,UAAU,EAAE,CAAA;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAC5B,CAAA"}
|
|
@@ -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"}
|
|
@@ -37,8 +37,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
37
37
|
onClose?: (() => any) | undefined;
|
|
38
38
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
39
39
|
default?: (props: {}) => any;
|
|
40
|
-
} & {
|
|
41
|
-
default?: (props: {}) => any;
|
|
42
40
|
}>;
|
|
43
41
|
type __VLS_WithSlots<T, S> = T & {
|
|
44
42
|
new (): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarModal/ScalarModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarModal/ScalarModal.vue"],"names":[],"mappings":"AA6OA;;;;;;;;;;GAUG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAIzC,+CAA+C;AAC/C,wBAAgB,QAAQ;;;;EAUvB;AACD,QAAA,MAAM,YAAY;WAIT,UAAU,CAAC,OAAO,QAAQ,CAAC;YAC1B,MAAM;gBACF,MAAM;eACP,MAAM;;;;;;WAHV,UAAU,CAAC,OAAO,QAAQ,CAAC;YAC1B,MAAM;gBACF,MAAM;eACP,MAAM;;;;;;cAuNL,CAAC,KAAK,IAAiB,KAAK,GAAG;EAUzC,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import ScalarModal_vue_vue_type_script_setup_true_lang_default, { useModal } fro
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
// src/components/ScalarModal/ScalarModal.vue
|
|
5
|
-
var ScalarModal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ScalarModal_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var ScalarModal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ScalarModal_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-09866bb7"]]);
|
|
6
6
|
export { ScalarModal_default as default, useModal };
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=ScalarModal.vue.js.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import ScalarDialog_default from "../ScalarDialog/ScalarDialog.vue.js";
|
|
1
2
|
import ScalarIconButton_default from "../ScalarIconButton/ScalarIconButton.vue.js";
|
|
2
3
|
import { cva, cx } from "@scalar/use-hooks/useBindCx";
|
|
3
|
-
import { createBlock, createCommentVNode, createElementBlock, createElementVNode,
|
|
4
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, reactive, renderSlot, toDisplayString, unref, useId, withCtx } from "vue";
|
|
4
5
|
import { ScalarIconX } from "@scalar/icons";
|
|
5
|
-
import { Dialog, DialogPanel, DialogTitle } from "@headlessui/vue";
|
|
6
6
|
// src/components/ScalarModal/ScalarModal.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var _hoisted_1 =
|
|
7
|
+
var _hoisted_1 = ["id"];
|
|
8
|
+
var _hoisted_2 = {
|
|
8
9
|
key: 0,
|
|
9
10
|
class: "close-button fixed top-2 right-2 z-10"
|
|
10
11
|
};
|
|
@@ -46,8 +47,29 @@ var ScalarModal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
46
47
|
emits: ["close"],
|
|
47
48
|
setup(__props, { emit: __emit }) {
|
|
48
49
|
const emit = __emit;
|
|
50
|
+
const titleId = useId();
|
|
51
|
+
/** Whether the modal is the full-height side panel rather than a centered panel */
|
|
52
|
+
const isFull = computed(() => __props.size === "full");
|
|
53
|
+
/** The full size dialog is an invisible full-viewport layer the side panel sits in */
|
|
54
|
+
const FULL_LAYOUT = "scalar-modal-layout-full m-0 h-dvh max-h-dvh w-dvw max-w-none overflow-visible rounded-none bg-transparent p-0 shadow-none backdrop:bg-transparent dark:backdrop:bg-transparent";
|
|
55
|
+
/**
|
|
56
|
+
* Sync user dismissals from the dialog back into the modal state.
|
|
57
|
+
*
|
|
58
|
+
* Only `false` updates come through here, since the dialog never opens itself. Programmatic
|
|
59
|
+
* closes via `state.hide()` do not emit `close`, which matches how the modal has always behaved.
|
|
60
|
+
*/
|
|
61
|
+
const handleOpenChange = (open) => {
|
|
62
|
+
if (!open) {
|
|
63
|
+
__props.state.hide();
|
|
64
|
+
emit("close");
|
|
65
|
+
}
|
|
66
|
+
};
|
|
49
67
|
const modal = cva({
|
|
50
|
-
base: [
|
|
68
|
+
base: [
|
|
69
|
+
"scalar-modal",
|
|
70
|
+
"flex flex-col mb-0 rounded-lg bg-b-1 p-0 text-left leading-snug text-c-1 opacity-0 w-[calc(100vw-12px)] md:w-[calc(100vw-16px)] lg:w-[calc(100vw-32px)]",
|
|
71
|
+
"overflow-visible"
|
|
72
|
+
].join(" "),
|
|
51
73
|
variants: {
|
|
52
74
|
size: {
|
|
53
75
|
xxs: "mt-[20svh] max-h-[60svh] max-w-[360px]",
|
|
@@ -85,45 +107,42 @@ var ScalarModal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
85
107
|
}
|
|
86
108
|
});
|
|
87
109
|
return (_ctx, _cache) => {
|
|
88
|
-
return openBlock(), createBlock(unref(
|
|
110
|
+
return openBlock(), createBlock(unref(ScalarDialog_default), {
|
|
111
|
+
"aria-labelledby": __props.title ? unref(titleId) : void 0,
|
|
112
|
+
class: normalizeClass(isFull.value ? FULL_LAYOUT : unref(modal)({
|
|
113
|
+
size: __props.size,
|
|
114
|
+
variant: __props.variant
|
|
115
|
+
})),
|
|
89
116
|
open: __props.state.open,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
emit("close");
|
|
93
|
-
})
|
|
117
|
+
style: normalizeStyle(isFull.value ? void 0 : { maxWidth: __props.maxWidth }),
|
|
118
|
+
"onUpdate:open": handleOpenChange
|
|
94
119
|
}, {
|
|
95
|
-
default: withCtx(() => [createElementVNode("div", {
|
|
96
|
-
class: normalizeClass(unref(modal)({
|
|
120
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
121
|
+
class: normalizeClass(isFull.value ? unref(modal)({
|
|
97
122
|
size: __props.size,
|
|
98
123
|
variant: __props.variant
|
|
99
|
-
})),
|
|
100
|
-
style: normalizeStyle({ maxWidth: __props.maxWidth })
|
|
101
|
-
}, {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
key: 1,
|
|
110
|
-
class: normalizeClass(__props.bodyClass)
|
|
111
|
-
}, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2)) : (openBlock(), createElementBlock("div", {
|
|
112
|
-
key: 2,
|
|
113
|
-
class: normalizeClass(unref(cx)(unref(body)({
|
|
114
|
-
size: __props.size,
|
|
115
|
-
variant: __props.variant
|
|
116
|
-
}), __props.bodyClass))
|
|
117
|
-
}, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2))]),
|
|
118
|
-
_: 3
|
|
119
|
-
}, 8, ["class", "style"]), __props.size === "full" ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(unref(ScalarIconButton_default), {
|
|
124
|
+
}) : "contents"),
|
|
125
|
+
style: normalizeStyle(isFull.value ? { maxWidth: __props.maxWidth } : void 0)
|
|
126
|
+
}, [__props.title ? (openBlock(), createElementBlock("h2", {
|
|
127
|
+
key: 0,
|
|
128
|
+
id: unref(titleId),
|
|
129
|
+
class: "scalar-modal-header text-c-1 m-0 -mb-1 rounded-lg px-3 pt-3 text-left text-sm font-medium"
|
|
130
|
+
}, toDisplayString(__props.title), 9, _hoisted_1)) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(isFull.value ? __props.bodyClass : unref(cx)(unref(body)({
|
|
131
|
+
size: __props.size,
|
|
132
|
+
variant: __props.variant
|
|
133
|
+
}), __props.bodyClass)) }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2)], 6), isFull.value ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(unref(ScalarIconButton_default), {
|
|
120
134
|
class: "hover:bg-b-3 focus:outline-none",
|
|
121
135
|
icon: unref(ScalarIconX),
|
|
122
136
|
label: "Close modal",
|
|
123
137
|
onClick: _cache[0] || (_cache[0] = ($event) => __props.state.hide())
|
|
124
|
-
}, null, 8, ["icon"])])) : createCommentVNode("", true)]
|
|
138
|
+
}, null, 8, ["icon"])])) : createCommentVNode("", true)]),
|
|
125
139
|
_: 3
|
|
126
|
-
}, 8, [
|
|
140
|
+
}, 8, [
|
|
141
|
+
"aria-labelledby",
|
|
142
|
+
"class",
|
|
143
|
+
"open",
|
|
144
|
+
"style"
|
|
145
|
+
]);
|
|
127
146
|
};
|
|
128
147
|
}
|
|
129
148
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarModal.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","
|
|
1
|
+
{"version":3,"file":"ScalarModal.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","ScalarDialog","_normalizeClass","_normalizeStyle","_withCtx","_createElementVNode","_createElementBlock","_toDisplayString","_renderSlot","_createVNode","ScalarIconButton"],"sources":["../../../src/components/ScalarModal/ScalarModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconX } from '@scalar/icons'\nimport { cva, cx } from '@scalar/use-hooks/useBindCx'\nimport type { VariantProps } from 'cva'\nimport { computed, reactive, useId } from 'vue'\n\nimport { ScalarDialog } from '../ScalarDialog'\nimport { ScalarIconButton } from '../ScalarIconButton'\n\ntype ModalVariants = VariantProps<typeof modal>\n\nconst { size = 'md', state } = defineProps<{\n state: ReturnType<typeof useModal>\n title?: string\n bodyClass?: string\n maxWidth?: string\n size?: ModalVariants['size']\n variant?: ModalVariants['variant']\n}>()\n\nconst emit = defineEmits<{\n /** Emitted when the user dismisses the modal with Escape or a backdrop click. */\n (event: 'close'): void\n}>()\n\nconst titleId = useId()\n\n/** Whether the modal is the full-height side panel rather than a centered panel */\nconst isFull = computed(() => size === 'full')\n\n/** The full size dialog is an invisible full-viewport layer the side panel sits in */\nconst FULL_LAYOUT =\n 'scalar-modal-layout-full m-0 h-dvh max-h-dvh w-dvw max-w-none overflow-visible rounded-none bg-transparent p-0 shadow-none backdrop:bg-transparent dark:backdrop:bg-transparent'\n\n/**\n * Sync user dismissals from the dialog back into the modal state.\n *\n * Only `false` updates come through here, since the dialog never opens itself. Programmatic\n * closes via `state.hide()` do not emit `close`, which matches how the modal has always behaved.\n */\nconst handleOpenChange = (open: boolean): void => {\n if (!open) {\n state.hide()\n emit('close')\n }\n}\n\nconst modal = cva({\n base: [\n 'scalar-modal',\n 'flex flex-col mb-0 rounded-lg bg-b-1 p-0 text-left leading-snug text-c-1 opacity-0 w-[calc(100vw-12px)] md:w-[calc(100vw-16px)] lg:w-[calc(100vw-32px)]',\n // Let form popovers overflow the panel rather than scrolling the whole dialog\n 'overflow-visible',\n ].join(' '),\n variants: {\n size: {\n xxs: 'mt-[20svh] max-h-[60svh] max-w-[360px]',\n xs: 'mt-[20svh] max-h-[60svh] max-w-[480px]',\n sm: 'mt-[20svh] max-h-[60svh] max-w-[540px]',\n md: 'mt-[20svh] max-h-[60svh] max-w-[640px]',\n lg: 'm-auto max-h-[80svh] max-w-[800px]',\n xl: 'm-auto max-h-[90svh] max-w-[1000px]',\n full: 'full-size-styles max-h-dvh mt-0 lg:w-full',\n },\n variant: {\n form: 'scalar-modal-form',\n search: 'scalar-modal-search mt-[15svh] max-h-[60svh] max-w-[540px]',\n error: 'scalar-modal-error',\n },\n },\n})\nconst body = cva({\n base: ['scalar-modal-body', 'relative flex-1 min-h-0 p-3'].join(' '),\n variants: {\n variant: {\n form: 'overflow-visible',\n search: 'flex flex-col !m-0 overflow-hidden p-0',\n error: 'overflow-y-scroll',\n },\n size: {\n xxs: '',\n xs: '',\n sm: '',\n md: '',\n lg: '',\n xl: 'm-0 p-0',\n full: ' rounded-none',\n },\n },\n})\n</script>\n<script lang=\"ts\">\n/**\n * Scalar Modal component\n *\n * A dialog overlay with configurable size and variant.\n * Use the {@link useModal} hook to control the open state.\n *\n * @example\n * <ScalarModal :state=\"modal\" title=\"My Modal\">\n * Modal content\n * </ScalarModal>\n */\nexport default {}\n\n/** Hook for creating a reactive modal state */\nexport function useModal() {\n return reactive({\n open: false,\n show() {\n this.open = true\n },\n hide() {\n this.open = false\n },\n })\n}\n</script>\n<template>\n <ScalarDialog\n :aria-labelledby=\"title ? titleId : undefined\"\n :class=\"isFull ? FULL_LAYOUT : modal({ size, variant })\"\n :open=\"state.open\"\n :style=\"isFull ? undefined : { maxWidth }\"\n @update:open=\"handleOpenChange\">\n <!-- The full size is a side panel, so the dialog fills the viewport and the panel sits inside\n it. Every other size is the panel itself, and the wrapper steps out of the layout. -->\n <div\n :class=\"isFull ? modal({ size, variant }) : 'contents'\"\n :style=\"isFull ? { maxWidth } : undefined\">\n <h2\n v-if=\"title\"\n :id=\"titleId\"\n class=\"scalar-modal-header text-c-1 m-0 -mb-1 rounded-lg px-3 pt-3 text-left text-sm font-medium\">\n {{ title }}\n </h2>\n <div :class=\"isFull ? bodyClass : cx(body({ size, variant }), bodyClass)\">\n <slot />\n </div>\n </div>\n <div\n v-if=\"isFull\"\n class=\"close-button fixed top-2 right-2 z-10\">\n <ScalarIconButton\n class=\"hover:bg-b-3 focus:outline-none\"\n :icon=\"ScalarIconX\"\n label=\"Close modal\"\n @click=\"state.hide()\" />\n </div>\n </ScalarDialog>\n</template>\n<style scoped>\n@reference '../../style.css';\n\n.scalar-modal::backdrop {\n animation: fadein-layout ease-in-out 0.3s forwards;\n}\n.scalar-modal {\n animation: fadein-modal ease-in-out 0.3s forwards;\n animation-delay: 0.1s;\n box-shadow: var(--scalar-shadow-2);\n transform: translate3d(0, 10px, 0);\n}\n.modal-content-search .modal-body {\n padding: 0;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n max-height: 440px;\n}\n/*\n * Allow the modal to fill more space on\n * very short (or very zoomed in) screens\n */\n@variant zoomed {\n .scalar-modal:not(.full-size-styles) {\n margin-top: 5svh;\n max-height: 90svh;\n }\n}\n@keyframes fadein-layout {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes fadein-modal {\n 0% {\n opacity: 0;\n transform: translate3d(0, 10px, 0);\n }\n 100% {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n}\n.full-size-styles {\n transform: translate3d(0, 0, 0);\n animation: fadein-layout ease-in-out 0.3s forwards;\n max-height: 100% !important;\n top: 0 !important;\n left: 0;\n position: absolute !important;\n margin: initial;\n border-radius: 0 !important;\n background-color: var(--scalar-background-1) !important;\n box-shadow: none !important;\n border-right: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n@variant md {\n .full-size-styles {\n width: 50dvw !important;\n }\n}\n.full-size-styles:after {\n content: '';\n width: 50dvw;\n height: 100dvh;\n position: absolute;\n right: -50dvw;\n top: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuGA,IAAA,cAAe,CAAC;;AAGhB,SAAgB,WAAW;CACzB,OAAO,SAAS;EACd,MAAM;EACN,OAAO;GACL,KAAK,OAAO;EACd;EACA,OAAO;GACL,KAAK,OAAO;EACd;CACF,CAAC;AACH;;;;;;;;;;;;;;EAhGA,MAAM,OAAO;EAKb,MAAM,UAAU,MAAM;;EAGtB,MAAM,SAAS,eAAe,QAAA,SAAS,MAAM;;EAG7C,MAAM,cACJ;;;;;;;EAQF,MAAM,oBAAoB,SAAwB;GAChD,IAAI,CAAC,MAAM;IACT,QAAA,MAAM,KAAK;IACX,KAAK,OAAO;GACd;EACF;EAEA,MAAM,QAAQ,IAAI;GAChB,MAAM;IACJ;IACA;IAEA;GACF,CAAC,CAAC,KAAK,GAAG;GACV,UAAU;IACR,MAAM;KACJ,KAAK;KACL,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,MAAM;IACR;IACA,SAAS;KACP,MAAM;KACN,QAAQ;KACR,OAAO;IACT;GACF;EACF,CAAC;EACD,MAAM,OAAO,IAAI;GACf,MAAM,CAAC,qBAAqB,6BAA6B,CAAC,CAAC,KAAK,GAAG;GACnE,UAAU;IACR,SAAS;KACP,MAAM;KACN,QAAQ;KACR,OAAO;IACT;IACA,MAAM;KACJ,KAAK;KACL,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,IAAI;KACJ,MAAM;IACR;GACF;EACF,CAAC;;GA8BC,OAAAA,UAAA,GAAAC,YA8BeC,MAAAC,oBAAA,GAAA;IA7BZ,mBAAiB,QAAA,QAAQD,MAAA,OAAA,IAAU,KAAA;IACnC,OAAKE,eAAE,OAAA,QAAS,cAAcF,MAAA,KAAA,CAAK,CAAA;KAAA,MAAG,QAAA;KAAI,SAAE,QAAA;IAAO,CAAA,CAAA;IACnD,MAAM,QAAA,MAAM;IACZ,OAAKG,eAAE,OAAA,QAAS,KAAA,IAAS,EAAA,UAAK,QAAA,SAAQ,CAAA;IACtC,iBAAa;;IAGd,SAAAC,cAYM,CAZNC,mBAYM,OAAA;KAXH,OAAKH,eAAE,OAAA,QAASF,MAAA,KAAA,CAAK,CAAA;MAAA,MAAG,QAAA;MAAI,SAAE,QAAA;KAAO,CAAA,IAAA,UAAA;KACrC,OAAKG,eAAE,OAAA,QAAM,EAAA,UAAK,QAAA,SAAQ,IAAK,KAAA,CAAS;I,IAEjC,QAAA,SADRL,UAAA,GAAAQ,mBAKK,MAAA;;KAHF,IAAIN,MAAA,OAAA;KACL,OAAM;IACH,GAAAO,gBAAA,QAAA,KAAK,GAAA,GAAA,UAAA,K,8BAEVF,mBAEM,OAAA,EAFA,OAAKH,eAAE,OAAA,QAAS,QAAA,YAAYF,MAAA,EAAA,CAAE,CAACA,MAAA,IAAA,CAAI,CAAA;KAAA,MAAG,QAAA;KAAI,SAAE,QAAA;IAAO,CAAA,GAAK,QAAA,SAAS,CAAA,E,IACrEQ,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,IAAA,C,YAIJ,OAAA,SADRV,UAAA,GAAAQ,mBAQM,OARN,YAQM,CALJG,YAI0BT,MAAAU,wBAAA,GAAA;KAHxB,OAAM;KACL,MAAMV,MAAA,WAAA;KACP,OAAM;KACL,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAA,MAAM,KAAI"}
|
|
@@ -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 },
|