@dicehub/kappa 0.7.0 → 1.0.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.
Files changed (121) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/THIRD_PARTY_NOTICES.md +103 -1
  3. package/dist/{DropdownSubTrigger-DrZmNIcU.js → DropdownSubTrigger-DVOFK5Y1.js} +202 -146
  4. package/dist/DropdownSubTrigger-DVOFK5Y1.js.map +1 -0
  5. package/dist/PoweredByDicehub-DPceYF8f.js +143 -0
  6. package/dist/PoweredByDicehub-DPceYF8f.js.map +1 -0
  7. package/dist/{WorkspaceSwitcher-DBWdKZbM.js → WorkspaceSwitcher-DDAIMxeE.js} +5 -9
  8. package/dist/WorkspaceSwitcher-DDAIMxeE.js.map +1 -0
  9. package/dist/app-shell-PGvfb1aZ.js +570 -0
  10. package/dist/app-shell-PGvfb1aZ.js.map +1 -0
  11. package/dist/blocks/app-shell/AppShell.vue.d.ts +41 -0
  12. package/dist/blocks/app-shell/AppShellActions.vue.d.ts +3 -0
  13. package/dist/blocks/app-shell/AppShellAsideResizeHandle.vue.d.ts +20 -0
  14. package/dist/blocks/app-shell/AppShellPage.vue.d.ts +6 -0
  15. package/dist/blocks/app-shell/AppShellPanels.vue.d.ts +33 -0
  16. package/dist/blocks/app-shell/AppShellSearchDialog.vue.d.ts +10 -0
  17. package/dist/blocks/app-shell/AppShellSearchTrigger.vue.d.ts +7 -0
  18. package/dist/blocks/app-shell/AppShellToolbar.vue.d.ts +3 -0
  19. package/dist/blocks/app-shell/app-shell.d.ts +67 -0
  20. package/dist/blocks/app-shell/index.d.ts +19 -0
  21. package/dist/blocks/app-shell.js +2 -0
  22. package/dist/blocks/file-browser.js +1 -1
  23. package/dist/blocks/index.d.ts +1 -0
  24. package/dist/blocks/sidebar-layout/SidebarLayout.vue.d.ts +2 -0
  25. package/dist/blocks/sidebar-layout/sidebar-layout.d.ts +14 -2
  26. package/dist/blocks/sidebar-layout.js +1 -1
  27. package/dist/blocks/workspace-switcher/workspace-switcher.d.ts +2 -0
  28. package/dist/blocks/workspace-switcher.js +1 -1
  29. package/dist/{breadcrumbs-CIxUxZVD.js → breadcrumbs-CPfb83sY.js} +36 -41
  30. package/dist/{breadcrumbs-CIxUxZVD.js.map → breadcrumbs-CPfb83sY.js.map} +1 -1
  31. package/dist/button-Cst2B-9X.js +208 -0
  32. package/dist/button-Cst2B-9X.js.map +1 -0
  33. package/dist/{command-palette-BHFB86Gc.js → command-palette-BjXvHrd6.js} +178 -165
  34. package/dist/command-palette-BjXvHrd6.js.map +1 -0
  35. package/dist/components/breadcrumbs.js +1 -1
  36. package/dist/components/button/index.d.ts +2 -0
  37. package/dist/components/button/toolbar-button.d.ts +23 -0
  38. package/dist/components/button.js +2 -2
  39. package/dist/components/command-palette/CommandPaletteResultItem.vue.d.ts +1 -1
  40. package/dist/components/command-palette.js +1 -1
  41. package/dist/components/context-menu/ContextMenu.vue.d.ts +5 -5
  42. package/dist/components/context-menu.js +2 -2
  43. package/dist/components/data-grid.js +1 -1
  44. package/dist/components/date-picker/DatePicker.vue.d.ts +1 -1
  45. package/dist/components/dialog/Dialog.vue.d.ts +7 -7
  46. package/dist/components/dialog-layout/DialogLayoutAlert.vue.d.ts +3 -3
  47. package/dist/components/dicehub-logo/dicehub-logo.d.ts +17 -4
  48. package/dist/components/dicehub-logo/index.d.ts +1 -1
  49. package/dist/components/dicehub-logo.js +2 -2
  50. package/dist/components/drawer/Drawer.vue.d.ts +3 -3
  51. package/dist/components/dropdown/Dropdown.vue.d.ts +5 -5
  52. package/dist/components/dropdown/DropdownContent.vue.d.ts +1 -0
  53. package/dist/components/dropdown/DropdownSub.vue.d.ts +5 -5
  54. package/dist/components/dropdown/DropdownSubContent.vue.d.ts +1 -0
  55. package/dist/components/dropdown/dropdown.d.ts +2 -0
  56. package/dist/components/dropdown/use-dropdown-focus.d.ts +6 -0
  57. package/dist/components/dropdown.js +2 -2
  58. package/dist/components/filter-bar.js +1 -1
  59. package/dist/components/hover-card/HoverCard.vue.d.ts +2 -2
  60. package/dist/components/kbd.js +1 -1
  61. package/dist/components/loader/Loader.vue.d.ts +1 -1
  62. package/dist/components/matrix-loader/MatrixLoader.vue.d.ts +1 -1
  63. package/dist/components/menu-bar.js +1 -1
  64. package/dist/components/popover/Popover.vue.d.ts +7 -7
  65. package/dist/components/sidebar/SidebarProvider.vue.d.ts +1 -0
  66. package/dist/components/sidebar/index.d.ts +1 -1
  67. package/dist/components/sidebar/sidebar-resize.d.ts +1 -0
  68. package/dist/components/sidebar/sidebar.d.ts +5 -1
  69. package/dist/components/sidebar.js +1 -1
  70. package/dist/components/table/TableCheckCell.vue.d.ts +1 -1
  71. package/dist/components/table/TableCheckHead.vue.d.ts +1 -1
  72. package/dist/components/toolbar/ToolbarButton.vue.d.ts +5 -1
  73. package/dist/components/toolbar/index.d.ts +3 -2
  74. package/dist/components/toolbar/toolbar.d.ts +2 -3
  75. package/dist/components/toolbar.js +3 -2
  76. package/dist/components/tooltip/Tooltip.vue.d.ts +5 -5
  77. package/dist/{context-menu-B_noSd5p.js → context-menu-WmJWrUGu.js} +2 -2
  78. package/dist/{context-menu-B_noSd5p.js.map → context-menu-WmJWrUGu.js.map} +1 -1
  79. package/dist/{data-grid-CobgDr8q.js → data-grid-BQkLsfk0.js} +2 -2
  80. package/dist/{data-grid-CobgDr8q.js.map → data-grid-BQkLsfk0.js.map} +1 -1
  81. package/dist/{dropdown-Dedb1tk8.js → dropdown-BABKXjuz.js} +2 -2
  82. package/dist/{dropdown-Dedb1tk8.js.map → dropdown-BABKXjuz.js.map} +1 -1
  83. package/dist/{file-browser-CGqaz2eI.js → file-browser-BxOJWvrF.js} +5 -5
  84. package/dist/{file-browser-CGqaz2eI.js.map → file-browser-BxOJWvrF.js.map} +1 -1
  85. package/dist/{filter-bar-COAlDQE4.js → filter-bar-CAyW-YoF.js} +2 -2
  86. package/dist/{filter-bar-COAlDQE4.js.map → filter-bar-CAyW-YoF.js.map} +1 -1
  87. package/dist/index.js +104 -103
  88. package/dist/{KbdGroup-CNwqr4vX.js → kbd-CNwqr4vX.js} +1 -1
  89. package/dist/kbd-CNwqr4vX.js.map +1 -0
  90. package/dist/{menu-bar-C-qQn2L1.js → menu-bar-DPJllpvf.js} +2 -2
  91. package/dist/{menu-bar-C-qQn2L1.js.map → menu-bar-DPJllpvf.js.map} +1 -1
  92. package/dist/paneled-bottom.png +0 -0
  93. package/dist/paneled-side.png +0 -0
  94. package/dist/registry/component-registry.json +15 -6
  95. package/dist/registry/generated.d.ts +75 -9
  96. package/dist/{registry-BhOIvW4q.js → registry-Bgb2nbb2.js} +102 -8
  97. package/dist/registry-Bgb2nbb2.js.map +1 -0
  98. package/dist/registry.js +1 -1
  99. package/dist/{sidebar-tcrbUrk_.js → sidebar-9TqPqgDD.js} +178 -157
  100. package/dist/sidebar-9TqPqgDD.js.map +1 -0
  101. package/dist/{SidebarLayout-D9RT-MdT.js → sidebar-layout-DRe1HpSt.js} +65 -46
  102. package/dist/sidebar-layout-DRe1HpSt.js.map +1 -0
  103. package/dist/styles/kappa.css +1 -1
  104. package/dist/styles/theme-kappa.css +296 -1
  105. package/dist/styles/tokens.json +767 -0
  106. package/dist/{toolbar-DC-4XdHD.js → toolbar-DJsnox8t.js} +90 -146
  107. package/dist/toolbar-DJsnox8t.js.map +1 -0
  108. package/licenses/nunito.LICENSE +93 -0
  109. package/package.json +1 -1
  110. package/dist/DropdownSubTrigger-DrZmNIcU.js.map +0 -1
  111. package/dist/KbdGroup-CNwqr4vX.js.map +0 -1
  112. package/dist/PoweredByDicehub-BD-y1NZA.js +0 -92
  113. package/dist/PoweredByDicehub-BD-y1NZA.js.map +0 -1
  114. package/dist/SidebarLayout-D9RT-MdT.js.map +0 -1
  115. package/dist/WorkspaceSwitcher-DBWdKZbM.js.map +0 -1
  116. package/dist/button-DSgFcDoO.js +0 -128
  117. package/dist/button-DSgFcDoO.js.map +0 -1
  118. package/dist/command-palette-BHFB86Gc.js.map +0 -1
  119. package/dist/registry-BhOIvW4q.js.map +0 -1
  120. package/dist/sidebar-tcrbUrk_.js.map +0 -1
  121. package/dist/toolbar-DC-4XdHD.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"filter-bar-COAlDQE4.js","names":[],"sources":["../src/components/filter-bar/filter-bar.ts","../src/components/filter-bar/FilterBar.vue","../src/components/filter-bar/FilterBar.vue"],"sourcesContent":["import type { VNodeChild } from \"vue\";\n\nexport type FilterBarView = \"list\" | \"grid\";\nexport type FilterBarSortDirection = \"asc\" | \"desc\";\n\nexport interface FilterBarSortOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface FilterBarLabels {\n root: string;\n search: string;\n searchPlaceholder: string;\n sort: string;\n ascending: string;\n descending: string;\n view: string;\n list: string;\n grid: string;\n}\n\nexport const FILTER_BAR_DEFAULT_LABELS: FilterBarLabels = {\n root: \"Filter resources\",\n search: \"Search resources\",\n searchPlaceholder: \"Filter by name...\",\n sort: \"Sort by\",\n ascending: \"Sort ascending\",\n descending: \"Sort descending\",\n view: \"Resource view\",\n list: \"List view\",\n grid: \"Grid view\",\n};\n\nexport interface FilterBarProps {\n /** Controlled search value. Use v-model. */\n modelValue?: string;\n /** Initial search value when uncontrolled. */\n defaultValue?: string;\n /** Hide search when the page supplies a separate search control. */\n showSearch?: boolean;\n /** Sorting controls are shown when this array is nonempty. */\n sortOptions?: readonly FilterBarSortOption[];\n /** Controlled sort field. Unknown values remain visible as plain text. */\n sortBy?: string;\n /** Initial sort field; otherwise uses the first enabled option. */\n defaultSortBy?: string;\n sortDirection?: FilterBarSortDirection;\n defaultSortDirection?: FilterBarSortDirection;\n /** Show a single-selection list/grid toggle. */\n showView?: boolean;\n view?: FilterBarView;\n defaultView?: FilterBarView;\n /** Disables built-in controls. Slots receive this state for their own controls. */\n disabled?: boolean;\n /** Replace any visible or accessible label for the current locale. */\n labels?: Partial<FilterBarLabels>;\n}\n\nexport type FilterBarEmits = {\n \"update:modelValue\": [value: string];\n \"update:sortBy\": [value: string];\n \"update:sortDirection\": [value: FilterBarSortDirection];\n \"update:view\": [value: FilterBarView];\n};\n\nexport interface FilterBarSlots {\n filters?: (props: { disabled: boolean }) => VNodeChild;\n actions?: (props: { disabled: boolean }) => VNodeChild;\n}\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { Button } from \"../button\";\nimport { Dropdown } from \"../dropdown\";\nimport { Input } from \"../input\";\nimport { ToggleGroup } from \"../toggle-group\";\nimport {\n FILTER_BAR_DEFAULT_LABELS,\n type FilterBarEmits,\n type FilterBarProps,\n type FilterBarSlots,\n type FilterBarSortDirection,\n type FilterBarView,\n} from \"./filter-bar\";\n\nconst props = withDefaults(defineProps<FilterBarProps>(), {\n showSearch: true,\n showView: false,\n disabled: false,\n sortOptions: () => [],\n});\nconst emit = defineEmits<FilterBarEmits>();\nconst slots = defineSlots<FilterBarSlots>();\n\nconst internalQuery = ref(props.defaultValue ?? \"\");\nconst internalSortBy = ref(props.defaultSortBy);\nconst internalDirection = ref<FilterBarSortDirection>(props.defaultSortDirection ?? \"desc\");\nconst internalView = ref<FilterBarView>(props.defaultView ?? \"list\");\nconst labels = computed(() => ({ ...FILTER_BAR_DEFAULT_LABELS, ...props.labels }));\nconst query = computed(() => props.modelValue ?? internalQuery.value);\nconst sortBy = computed(() => props.sortBy ?? internalSortBy.value ?? props.sortOptions.find(option => !option.disabled)?.value ?? \"\");\nconst direction = computed(() => props.sortDirection ?? internalDirection.value);\nconst view = computed(() => props.view ?? internalView.value);\nconst sortLabel = computed(() => props.sortOptions.find(option => option.value === sortBy.value)?.label ?? sortBy.value);\nconst directionLabel = computed(() => direction.value === \"desc\" ? labels.value.ascending : labels.value.descending);\n\nfunction updateQuery(value: string) {\n if (props.disabled) return;\n if (props.modelValue === undefined) internalQuery.value = value;\n emit(\"update:modelValue\", value);\n}\n\nfunction updateSortBy(value: string) {\n if (props.disabled || !props.sortOptions.some(option => option.value === value && !option.disabled)) return;\n if (props.sortBy === undefined) internalSortBy.value = value;\n emit(\"update:sortBy\", value);\n}\n\nfunction toggleDirection() {\n if (props.disabled) return;\n const value = direction.value === \"desc\" ? \"asc\" : \"desc\";\n if (props.sortDirection === undefined) internalDirection.value = value;\n emit(\"update:sortDirection\", value);\n}\n\nfunction updateView(values: string[]) {\n const value = values[0];\n if (props.disabled || (value !== \"list\" && value !== \"grid\")) return;\n if (props.view === undefined) internalView.value = value;\n emit(\"update:view\", value);\n}\n</script>\n\n<template>\n <div class=\"kappa-filter-bar\" data-slot=\"filter-bar\" role=\"group\" :aria-label=\"labels.root\" :data-disabled=\"props.disabled ? '' : undefined\">\n <div v-if=\"props.showSearch\" class=\"kappa-filter-bar__search\" data-slot=\"filter-bar-search\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"4\" /><path d=\"m10 10 3 3\" />\n </svg>\n <Input :model-value=\"query\" type=\"search\" size=\"sm\" :disabled=\"props.disabled\" :aria-label=\"labels.search\" :placeholder=\"labels.searchPlaceholder\" @update:model-value=\"updateQuery\" />\n </div>\n\n <div v-if=\"props.sortOptions.length\" class=\"kappa-filter-bar__sort\" data-slot=\"filter-bar-sort\">\n <Dropdown.Root :aria-label=\"labels.sort\" :positioning=\"{ placement: 'bottom-start' }\">\n <Dropdown.Trigger as-child>\n <Button variant=\"outline\" size=\"sm\" :disabled=\"props.disabled\" :aria-label=\"`${labels.sort}: ${sortLabel}`\" class=\"kappa-filter-bar__sort-trigger\">\n <span>{{ sortLabel || labels.sort }}</span><Dropdown.Indicator />\n </Button>\n </Dropdown.Trigger>\n <Dropdown.Content>\n <Dropdown.RadioGroup :model-value=\"sortBy\" @update:model-value=\"updateSortBy\">\n <Dropdown.Label>{{ labels.sort }}</Dropdown.Label>\n <Dropdown.RadioItem v-for=\"option in props.sortOptions\" :key=\"option.value\" :value=\"option.value\" :disabled=\"props.disabled || option.disabled\" close-on-select>\n {{ option.label }}\n </Dropdown.RadioItem>\n </Dropdown.RadioGroup>\n </Dropdown.Content>\n </Dropdown.Root>\n <Button variant=\"outline\" size=\"sm\" shape=\"square\" :disabled=\"props.disabled\" :aria-label=\"directionLabel\" :title=\"directionLabel\" data-slot=\"filter-bar-sort-direction\" @click=\"toggleDirection\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M2.5 4h7M2.5 8h5M2.5 12h3\" />\n <path v-if=\"direction === 'desc'\" d=\"M12 3v10m-2-2 2 2 2-2\" />\n <path v-else d=\"M12 13V3m-2 2 2-2 2 2\" />\n </svg>\n </Button>\n </div>\n\n <div v-if=\"slots.filters\" class=\"kappa-filter-bar__filters\" data-slot=\"filter-bar-filters\">\n <slot name=\"filters\" :disabled=\"props.disabled\" />\n </div>\n\n <div v-if=\"props.showView || slots.actions\" class=\"kappa-filter-bar__actions\" data-slot=\"filter-bar-actions\">\n <ToggleGroup.Root v-if=\"props.showView\" :model-value=\"[view]\" :disabled=\"props.disabled\" :deselectable=\"false\" :aria-label=\"labels.view\" size=\"sm\" spacing=\"none\" variant=\"outline\" class=\"kappa-filter-bar__view\" @update:model-value=\"updateView\">\n <ToggleGroup.Item value=\"list\" :aria-label=\"labels.list\" :title=\"labels.list\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M5.5 4h8M5.5 8h8M5.5 12h8M2.5 4h.01M2.5 8h.01M2.5 12h.01\" /></svg>\n </ToggleGroup.Item>\n <ToggleGroup.Item value=\"grid\" :aria-label=\"labels.grid\" :title=\"labels.grid\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><rect x=\"2.5\" y=\"2.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"9.5\" y=\"2.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"2.5\" y=\"9.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"9.5\" y=\"9.5\" width=\"4\" height=\"4\" rx=\".5\" /></svg>\n </ToggleGroup.Item>\n </ToggleGroup.Root>\n <slot name=\"actions\" :disabled=\"props.disabled\" />\n </div>\n </div>\n</template>\n\n<style src=\"./filter-bar.css\"></style>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { Button } from \"../button\";\nimport { Dropdown } from \"../dropdown\";\nimport { Input } from \"../input\";\nimport { ToggleGroup } from \"../toggle-group\";\nimport {\n FILTER_BAR_DEFAULT_LABELS,\n type FilterBarEmits,\n type FilterBarProps,\n type FilterBarSlots,\n type FilterBarSortDirection,\n type FilterBarView,\n} from \"./filter-bar\";\n\nconst props = withDefaults(defineProps<FilterBarProps>(), {\n showSearch: true,\n showView: false,\n disabled: false,\n sortOptions: () => [],\n});\nconst emit = defineEmits<FilterBarEmits>();\nconst slots = defineSlots<FilterBarSlots>();\n\nconst internalQuery = ref(props.defaultValue ?? \"\");\nconst internalSortBy = ref(props.defaultSortBy);\nconst internalDirection = ref<FilterBarSortDirection>(props.defaultSortDirection ?? \"desc\");\nconst internalView = ref<FilterBarView>(props.defaultView ?? \"list\");\nconst labels = computed(() => ({ ...FILTER_BAR_DEFAULT_LABELS, ...props.labels }));\nconst query = computed(() => props.modelValue ?? internalQuery.value);\nconst sortBy = computed(() => props.sortBy ?? internalSortBy.value ?? props.sortOptions.find(option => !option.disabled)?.value ?? \"\");\nconst direction = computed(() => props.sortDirection ?? internalDirection.value);\nconst view = computed(() => props.view ?? internalView.value);\nconst sortLabel = computed(() => props.sortOptions.find(option => option.value === sortBy.value)?.label ?? sortBy.value);\nconst directionLabel = computed(() => direction.value === \"desc\" ? labels.value.ascending : labels.value.descending);\n\nfunction updateQuery(value: string) {\n if (props.disabled) return;\n if (props.modelValue === undefined) internalQuery.value = value;\n emit(\"update:modelValue\", value);\n}\n\nfunction updateSortBy(value: string) {\n if (props.disabled || !props.sortOptions.some(option => option.value === value && !option.disabled)) return;\n if (props.sortBy === undefined) internalSortBy.value = value;\n emit(\"update:sortBy\", value);\n}\n\nfunction toggleDirection() {\n if (props.disabled) return;\n const value = direction.value === \"desc\" ? \"asc\" : \"desc\";\n if (props.sortDirection === undefined) internalDirection.value = value;\n emit(\"update:sortDirection\", value);\n}\n\nfunction updateView(values: string[]) {\n const value = values[0];\n if (props.disabled || (value !== \"list\" && value !== \"grid\")) return;\n if (props.view === undefined) internalView.value = value;\n emit(\"update:view\", value);\n}\n</script>\n\n<template>\n <div class=\"kappa-filter-bar\" data-slot=\"filter-bar\" role=\"group\" :aria-label=\"labels.root\" :data-disabled=\"props.disabled ? '' : undefined\">\n <div v-if=\"props.showSearch\" class=\"kappa-filter-bar__search\" data-slot=\"filter-bar-search\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"4\" /><path d=\"m10 10 3 3\" />\n </svg>\n <Input :model-value=\"query\" type=\"search\" size=\"sm\" :disabled=\"props.disabled\" :aria-label=\"labels.search\" :placeholder=\"labels.searchPlaceholder\" @update:model-value=\"updateQuery\" />\n </div>\n\n <div v-if=\"props.sortOptions.length\" class=\"kappa-filter-bar__sort\" data-slot=\"filter-bar-sort\">\n <Dropdown.Root :aria-label=\"labels.sort\" :positioning=\"{ placement: 'bottom-start' }\">\n <Dropdown.Trigger as-child>\n <Button variant=\"outline\" size=\"sm\" :disabled=\"props.disabled\" :aria-label=\"`${labels.sort}: ${sortLabel}`\" class=\"kappa-filter-bar__sort-trigger\">\n <span>{{ sortLabel || labels.sort }}</span><Dropdown.Indicator />\n </Button>\n </Dropdown.Trigger>\n <Dropdown.Content>\n <Dropdown.RadioGroup :model-value=\"sortBy\" @update:model-value=\"updateSortBy\">\n <Dropdown.Label>{{ labels.sort }}</Dropdown.Label>\n <Dropdown.RadioItem v-for=\"option in props.sortOptions\" :key=\"option.value\" :value=\"option.value\" :disabled=\"props.disabled || option.disabled\" close-on-select>\n {{ option.label }}\n </Dropdown.RadioItem>\n </Dropdown.RadioGroup>\n </Dropdown.Content>\n </Dropdown.Root>\n <Button variant=\"outline\" size=\"sm\" shape=\"square\" :disabled=\"props.disabled\" :aria-label=\"directionLabel\" :title=\"directionLabel\" data-slot=\"filter-bar-sort-direction\" @click=\"toggleDirection\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M2.5 4h7M2.5 8h5M2.5 12h3\" />\n <path v-if=\"direction === 'desc'\" d=\"M12 3v10m-2-2 2 2 2-2\" />\n <path v-else d=\"M12 13V3m-2 2 2-2 2 2\" />\n </svg>\n </Button>\n </div>\n\n <div v-if=\"slots.filters\" class=\"kappa-filter-bar__filters\" data-slot=\"filter-bar-filters\">\n <slot name=\"filters\" :disabled=\"props.disabled\" />\n </div>\n\n <div v-if=\"props.showView || slots.actions\" class=\"kappa-filter-bar__actions\" data-slot=\"filter-bar-actions\">\n <ToggleGroup.Root v-if=\"props.showView\" :model-value=\"[view]\" :disabled=\"props.disabled\" :deselectable=\"false\" :aria-label=\"labels.view\" size=\"sm\" spacing=\"none\" variant=\"outline\" class=\"kappa-filter-bar__view\" @update:model-value=\"updateView\">\n <ToggleGroup.Item value=\"list\" :aria-label=\"labels.list\" :title=\"labels.list\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M5.5 4h8M5.5 8h8M5.5 12h8M2.5 4h.01M2.5 8h.01M2.5 12h.01\" /></svg>\n </ToggleGroup.Item>\n <ToggleGroup.Item value=\"grid\" :aria-label=\"labels.grid\" :title=\"labels.grid\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><rect x=\"2.5\" y=\"2.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"9.5\" y=\"2.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"2.5\" y=\"9.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"9.5\" y=\"9.5\" width=\"4\" height=\"4\" rx=\".5\" /></svg>\n </ToggleGroup.Item>\n </ToggleGroup.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/C,GAAE;OAAM,GAAE;OAAM,OAAM;OAAI,QAAO;OAAI,IAAG;;MAAO,EAAqD,QAAA;OAA/C,GAAE;OAAM,GAAE;OAAM,OAAM;OAAI,QAAO;OAAI,IAAG;;MAAO,EAAqD,QAAA;OAA/C,GAAE;OAAM,GAAE;OAAM,OAAM;OAAI,QAAO;OAAI,IAAG;;;;;;;;;;GAGzQ,CAAA,KAAA,EAAA,IAAA,EAAA,GAAA,EAAkD,EAAA,QAAA,WAAA,EAA5B,UAAU,EAAM,SAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
1
+ {"version":3,"file":"filter-bar-CAyW-YoF.js","names":[],"sources":["../src/components/filter-bar/filter-bar.ts","../src/components/filter-bar/FilterBar.vue","../src/components/filter-bar/FilterBar.vue"],"sourcesContent":["import type { VNodeChild } from \"vue\";\n\nexport type FilterBarView = \"list\" | \"grid\";\nexport type FilterBarSortDirection = \"asc\" | \"desc\";\n\nexport interface FilterBarSortOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface FilterBarLabels {\n root: string;\n search: string;\n searchPlaceholder: string;\n sort: string;\n ascending: string;\n descending: string;\n view: string;\n list: string;\n grid: string;\n}\n\nexport const FILTER_BAR_DEFAULT_LABELS: FilterBarLabels = {\n root: \"Filter resources\",\n search: \"Search resources\",\n searchPlaceholder: \"Filter by name...\",\n sort: \"Sort by\",\n ascending: \"Sort ascending\",\n descending: \"Sort descending\",\n view: \"Resource view\",\n list: \"List view\",\n grid: \"Grid view\",\n};\n\nexport interface FilterBarProps {\n /** Controlled search value. Use v-model. */\n modelValue?: string;\n /** Initial search value when uncontrolled. */\n defaultValue?: string;\n /** Hide search when the page supplies a separate search control. */\n showSearch?: boolean;\n /** Sorting controls are shown when this array is nonempty. */\n sortOptions?: readonly FilterBarSortOption[];\n /** Controlled sort field. Unknown values remain visible as plain text. */\n sortBy?: string;\n /** Initial sort field; otherwise uses the first enabled option. */\n defaultSortBy?: string;\n sortDirection?: FilterBarSortDirection;\n defaultSortDirection?: FilterBarSortDirection;\n /** Show a single-selection list/grid toggle. */\n showView?: boolean;\n view?: FilterBarView;\n defaultView?: FilterBarView;\n /** Disables built-in controls. Slots receive this state for their own controls. */\n disabled?: boolean;\n /** Replace any visible or accessible label for the current locale. */\n labels?: Partial<FilterBarLabels>;\n}\n\nexport type FilterBarEmits = {\n \"update:modelValue\": [value: string];\n \"update:sortBy\": [value: string];\n \"update:sortDirection\": [value: FilterBarSortDirection];\n \"update:view\": [value: FilterBarView];\n};\n\nexport interface FilterBarSlots {\n filters?: (props: { disabled: boolean }) => VNodeChild;\n actions?: (props: { disabled: boolean }) => VNodeChild;\n}\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { Button } from \"../button\";\nimport { Dropdown } from \"../dropdown\";\nimport { Input } from \"../input\";\nimport { ToggleGroup } from \"../toggle-group\";\nimport {\n FILTER_BAR_DEFAULT_LABELS,\n type FilterBarEmits,\n type FilterBarProps,\n type FilterBarSlots,\n type FilterBarSortDirection,\n type FilterBarView,\n} from \"./filter-bar\";\n\nconst props = withDefaults(defineProps<FilterBarProps>(), {\n showSearch: true,\n showView: false,\n disabled: false,\n sortOptions: () => [],\n});\nconst emit = defineEmits<FilterBarEmits>();\nconst slots = defineSlots<FilterBarSlots>();\n\nconst internalQuery = ref(props.defaultValue ?? \"\");\nconst internalSortBy = ref(props.defaultSortBy);\nconst internalDirection = ref<FilterBarSortDirection>(props.defaultSortDirection ?? \"desc\");\nconst internalView = ref<FilterBarView>(props.defaultView ?? \"list\");\nconst labels = computed(() => ({ ...FILTER_BAR_DEFAULT_LABELS, ...props.labels }));\nconst query = computed(() => props.modelValue ?? internalQuery.value);\nconst sortBy = computed(() => props.sortBy ?? internalSortBy.value ?? props.sortOptions.find(option => !option.disabled)?.value ?? \"\");\nconst direction = computed(() => props.sortDirection ?? internalDirection.value);\nconst view = computed(() => props.view ?? internalView.value);\nconst sortLabel = computed(() => props.sortOptions.find(option => option.value === sortBy.value)?.label ?? sortBy.value);\nconst directionLabel = computed(() => direction.value === \"desc\" ? labels.value.ascending : labels.value.descending);\n\nfunction updateQuery(value: string) {\n if (props.disabled) return;\n if (props.modelValue === undefined) internalQuery.value = value;\n emit(\"update:modelValue\", value);\n}\n\nfunction updateSortBy(value: string) {\n if (props.disabled || !props.sortOptions.some(option => option.value === value && !option.disabled)) return;\n if (props.sortBy === undefined) internalSortBy.value = value;\n emit(\"update:sortBy\", value);\n}\n\nfunction toggleDirection() {\n if (props.disabled) return;\n const value = direction.value === \"desc\" ? \"asc\" : \"desc\";\n if (props.sortDirection === undefined) internalDirection.value = value;\n emit(\"update:sortDirection\", value);\n}\n\nfunction updateView(values: string[]) {\n const value = values[0];\n if (props.disabled || (value !== \"list\" && value !== \"grid\")) return;\n if (props.view === undefined) internalView.value = value;\n emit(\"update:view\", value);\n}\n</script>\n\n<template>\n <div class=\"kappa-filter-bar\" data-slot=\"filter-bar\" role=\"group\" :aria-label=\"labels.root\" :data-disabled=\"props.disabled ? '' : undefined\">\n <div v-if=\"props.showSearch\" class=\"kappa-filter-bar__search\" data-slot=\"filter-bar-search\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"4\" /><path d=\"m10 10 3 3\" />\n </svg>\n <Input :model-value=\"query\" type=\"search\" size=\"sm\" :disabled=\"props.disabled\" :aria-label=\"labels.search\" :placeholder=\"labels.searchPlaceholder\" @update:model-value=\"updateQuery\" />\n </div>\n\n <div v-if=\"props.sortOptions.length\" class=\"kappa-filter-bar__sort\" data-slot=\"filter-bar-sort\">\n <Dropdown.Root :aria-label=\"labels.sort\" :positioning=\"{ placement: 'bottom-start' }\">\n <Dropdown.Trigger as-child>\n <Button variant=\"outline\" size=\"sm\" :disabled=\"props.disabled\" :aria-label=\"`${labels.sort}: ${sortLabel}`\" class=\"kappa-filter-bar__sort-trigger\">\n <span>{{ sortLabel || labels.sort }}</span><Dropdown.Indicator />\n </Button>\n </Dropdown.Trigger>\n <Dropdown.Content>\n <Dropdown.RadioGroup :model-value=\"sortBy\" @update:model-value=\"updateSortBy\">\n <Dropdown.Label>{{ labels.sort }}</Dropdown.Label>\n <Dropdown.RadioItem v-for=\"option in props.sortOptions\" :key=\"option.value\" :value=\"option.value\" :disabled=\"props.disabled || option.disabled\" close-on-select>\n {{ option.label }}\n </Dropdown.RadioItem>\n </Dropdown.RadioGroup>\n </Dropdown.Content>\n </Dropdown.Root>\n <Button variant=\"outline\" size=\"sm\" shape=\"square\" :disabled=\"props.disabled\" :aria-label=\"directionLabel\" :title=\"directionLabel\" data-slot=\"filter-bar-sort-direction\" @click=\"toggleDirection\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M2.5 4h7M2.5 8h5M2.5 12h3\" />\n <path v-if=\"direction === 'desc'\" d=\"M12 3v10m-2-2 2 2 2-2\" />\n <path v-else d=\"M12 13V3m-2 2 2-2 2 2\" />\n </svg>\n </Button>\n </div>\n\n <div v-if=\"slots.filters\" class=\"kappa-filter-bar__filters\" data-slot=\"filter-bar-filters\">\n <slot name=\"filters\" :disabled=\"props.disabled\" />\n </div>\n\n <div v-if=\"props.showView || slots.actions\" class=\"kappa-filter-bar__actions\" data-slot=\"filter-bar-actions\">\n <ToggleGroup.Root v-if=\"props.showView\" :model-value=\"[view]\" :disabled=\"props.disabled\" :deselectable=\"false\" :aria-label=\"labels.view\" size=\"sm\" spacing=\"none\" variant=\"outline\" class=\"kappa-filter-bar__view\" @update:model-value=\"updateView\">\n <ToggleGroup.Item value=\"list\" :aria-label=\"labels.list\" :title=\"labels.list\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M5.5 4h8M5.5 8h8M5.5 12h8M2.5 4h.01M2.5 8h.01M2.5 12h.01\" /></svg>\n </ToggleGroup.Item>\n <ToggleGroup.Item value=\"grid\" :aria-label=\"labels.grid\" :title=\"labels.grid\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><rect x=\"2.5\" y=\"2.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"9.5\" y=\"2.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"2.5\" y=\"9.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"9.5\" y=\"9.5\" width=\"4\" height=\"4\" rx=\".5\" /></svg>\n </ToggleGroup.Item>\n </ToggleGroup.Root>\n <slot name=\"actions\" :disabled=\"props.disabled\" />\n </div>\n </div>\n</template>\n\n<style src=\"./filter-bar.css\"></style>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { Button } from \"../button\";\nimport { Dropdown } from \"../dropdown\";\nimport { Input } from \"../input\";\nimport { ToggleGroup } from \"../toggle-group\";\nimport {\n FILTER_BAR_DEFAULT_LABELS,\n type FilterBarEmits,\n type FilterBarProps,\n type FilterBarSlots,\n type FilterBarSortDirection,\n type FilterBarView,\n} from \"./filter-bar\";\n\nconst props = withDefaults(defineProps<FilterBarProps>(), {\n showSearch: true,\n showView: false,\n disabled: false,\n sortOptions: () => [],\n});\nconst emit = defineEmits<FilterBarEmits>();\nconst slots = defineSlots<FilterBarSlots>();\n\nconst internalQuery = ref(props.defaultValue ?? \"\");\nconst internalSortBy = ref(props.defaultSortBy);\nconst internalDirection = ref<FilterBarSortDirection>(props.defaultSortDirection ?? \"desc\");\nconst internalView = ref<FilterBarView>(props.defaultView ?? \"list\");\nconst labels = computed(() => ({ ...FILTER_BAR_DEFAULT_LABELS, ...props.labels }));\nconst query = computed(() => props.modelValue ?? internalQuery.value);\nconst sortBy = computed(() => props.sortBy ?? internalSortBy.value ?? props.sortOptions.find(option => !option.disabled)?.value ?? \"\");\nconst direction = computed(() => props.sortDirection ?? internalDirection.value);\nconst view = computed(() => props.view ?? internalView.value);\nconst sortLabel = computed(() => props.sortOptions.find(option => option.value === sortBy.value)?.label ?? sortBy.value);\nconst directionLabel = computed(() => direction.value === \"desc\" ? labels.value.ascending : labels.value.descending);\n\nfunction updateQuery(value: string) {\n if (props.disabled) return;\n if (props.modelValue === undefined) internalQuery.value = value;\n emit(\"update:modelValue\", value);\n}\n\nfunction updateSortBy(value: string) {\n if (props.disabled || !props.sortOptions.some(option => option.value === value && !option.disabled)) return;\n if (props.sortBy === undefined) internalSortBy.value = value;\n emit(\"update:sortBy\", value);\n}\n\nfunction toggleDirection() {\n if (props.disabled) return;\n const value = direction.value === \"desc\" ? \"asc\" : \"desc\";\n if (props.sortDirection === undefined) internalDirection.value = value;\n emit(\"update:sortDirection\", value);\n}\n\nfunction updateView(values: string[]) {\n const value = values[0];\n if (props.disabled || (value !== \"list\" && value !== \"grid\")) return;\n if (props.view === undefined) internalView.value = value;\n emit(\"update:view\", value);\n}\n</script>\n\n<template>\n <div class=\"kappa-filter-bar\" data-slot=\"filter-bar\" role=\"group\" :aria-label=\"labels.root\" :data-disabled=\"props.disabled ? '' : undefined\">\n <div v-if=\"props.showSearch\" class=\"kappa-filter-bar__search\" data-slot=\"filter-bar-search\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"4\" /><path d=\"m10 10 3 3\" />\n </svg>\n <Input :model-value=\"query\" type=\"search\" size=\"sm\" :disabled=\"props.disabled\" :aria-label=\"labels.search\" :placeholder=\"labels.searchPlaceholder\" @update:model-value=\"updateQuery\" />\n </div>\n\n <div v-if=\"props.sortOptions.length\" class=\"kappa-filter-bar__sort\" data-slot=\"filter-bar-sort\">\n <Dropdown.Root :aria-label=\"labels.sort\" :positioning=\"{ placement: 'bottom-start' }\">\n <Dropdown.Trigger as-child>\n <Button variant=\"outline\" size=\"sm\" :disabled=\"props.disabled\" :aria-label=\"`${labels.sort}: ${sortLabel}`\" class=\"kappa-filter-bar__sort-trigger\">\n <span>{{ sortLabel || labels.sort }}</span><Dropdown.Indicator />\n </Button>\n </Dropdown.Trigger>\n <Dropdown.Content>\n <Dropdown.RadioGroup :model-value=\"sortBy\" @update:model-value=\"updateSortBy\">\n <Dropdown.Label>{{ labels.sort }}</Dropdown.Label>\n <Dropdown.RadioItem v-for=\"option in props.sortOptions\" :key=\"option.value\" :value=\"option.value\" :disabled=\"props.disabled || option.disabled\" close-on-select>\n {{ option.label }}\n </Dropdown.RadioItem>\n </Dropdown.RadioGroup>\n </Dropdown.Content>\n </Dropdown.Root>\n <Button variant=\"outline\" size=\"sm\" shape=\"square\" :disabled=\"props.disabled\" :aria-label=\"directionLabel\" :title=\"directionLabel\" data-slot=\"filter-bar-sort-direction\" @click=\"toggleDirection\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M2.5 4h7M2.5 8h5M2.5 12h3\" />\n <path v-if=\"direction === 'desc'\" d=\"M12 3v10m-2-2 2 2 2-2\" />\n <path v-else d=\"M12 13V3m-2 2 2-2 2 2\" />\n </svg>\n </Button>\n </div>\n\n <div v-if=\"slots.filters\" class=\"kappa-filter-bar__filters\" data-slot=\"filter-bar-filters\">\n <slot name=\"filters\" :disabled=\"props.disabled\" />\n </div>\n\n <div v-if=\"props.showView || slots.actions\" class=\"kappa-filter-bar__actions\" data-slot=\"filter-bar-actions\">\n <ToggleGroup.Root v-if=\"props.showView\" :model-value=\"[view]\" :disabled=\"props.disabled\" :deselectable=\"false\" :aria-label=\"labels.view\" size=\"sm\" spacing=\"none\" variant=\"outline\" class=\"kappa-filter-bar__view\" @update:model-value=\"updateView\">\n <ToggleGroup.Item value=\"list\" :aria-label=\"labels.list\" :title=\"labels.list\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M5.5 4h8M5.5 8h8M5.5 12h8M2.5 4h.01M2.5 8h.01M2.5 12h.01\" /></svg>\n </ToggleGroup.Item>\n <ToggleGroup.Item value=\"grid\" :aria-label=\"labels.grid\" :title=\"labels.grid\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><rect x=\"2.5\" y=\"2.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"9.5\" y=\"2.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"2.5\" y=\"9.5\" width=\"4\" height=\"4\" rx=\".5\" /><rect x=\"9.5\" y=\"9.5\" width=\"4\" height=\"4\" rx=\".5\" /></svg>\n </ToggleGroup.Item>\n </ToggleGroup.Root>\n <slot name=\"actions\" :disabled=\"props.disabled\" />\n </div>\n </div>\n</template>\n\n<style src=\"./filter-bar.css\"></style>\n"],"mappings":";;;;;;AAuBA,IAAa,IAA6C;CACxD,MAAM;CACN,QAAQ;CACR,mBAAmB;CACnB,MAAM;CACN,WAAW;CACX,YAAY;CACZ,MAAM;CACN,MAAM;CACN,MAAM;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EClBA,IAAM,IAAQ,GAMR,IAAO,GACP,IAAQ,EAAA,GAER,IAAgB,EAAI,EAAM,gBAAgB,EAAE,GAC5C,IAAiB,EAAI,EAAM,aAAa,GACxC,IAAoB,EAA4B,EAAM,wBAAwB,MAAM,GACpF,IAAe,EAAmB,EAAM,eAAe,MAAM,GAC7D,IAAS,SAAgB;GAAE,GAAG;GAA2B,GAAG,EAAM;EAAO,EAAE,GAC3E,IAAQ,QAAe,EAAM,cAAc,EAAc,KAAK,GAC9D,IAAS,QAAe,EAAM,UAAU,EAAe,SAAS,EAAM,YAAY,MAAK,MAAU,CAAC,EAAO,QAAQ,CAAC,EAAE,SAAS,EAAE,GAC/H,IAAY,QAAe,EAAM,iBAAiB,EAAkB,KAAK,GACzE,IAAO,QAAe,EAAM,QAAQ,EAAa,KAAK,GACtD,IAAY,QAAe,EAAM,YAAY,MAAK,MAAU,EAAO,UAAU,EAAO,KAAK,CAAC,EAAE,SAAS,EAAO,KAAK,GACjH,IAAiB,QAAe,EAAU,UAAU,SAAS,EAAO,MAAM,YAAY,EAAO,MAAM,UAAU;EAEnH,SAAS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