@auronui/vue 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai-rules.md +217 -0
- package/dist/cjs/index.cjs +3 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js.map +1 -1
- package/dist/components/autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/combo-box/ComboBox.js.map +1 -1
- package/dist/components/combo-box/ComboBox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/combo-box/ComboBox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/Select.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/select/Select.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/package.json +2 -2
package/ai-rules.md
CHANGED
|
@@ -847,6 +847,219 @@ const pageRows = computed(() =>
|
|
|
847
847
|
|
|
848
848
|
---
|
|
849
849
|
|
|
850
|
+
## Composables
|
|
851
|
+
|
|
852
|
+
Every stateful component ships a matching `use*` composable for headless control from outside the component tree. All composables are imported from `@auronui/vue`.
|
|
853
|
+
|
|
854
|
+
### useDisclosure — open/close state (14 components)
|
|
855
|
+
|
|
856
|
+
Controls Modal, Drawer, Popover, Tooltip, AlertDialog, Collapsible, Dropdown, Select, ComboBox, DatePicker, DateRangePicker, DateTimePicker, Autocomplete, ColorPicker.
|
|
857
|
+
|
|
858
|
+
```ts
|
|
859
|
+
import { useDisclosure } from '@auronui/vue'
|
|
860
|
+
|
|
861
|
+
const modal = useDisclosure() // closed by default
|
|
862
|
+
const drawer = useDisclosure(true) // open by default
|
|
863
|
+
|
|
864
|
+
modal.open()
|
|
865
|
+
modal.close()
|
|
866
|
+
modal.toggle()
|
|
867
|
+
modal.isOpen // Readonly<Ref<boolean>>
|
|
868
|
+
```
|
|
869
|
+
|
|
870
|
+
```html
|
|
871
|
+
<Modal :open="modal.isOpen.value" @update:open="modal.onOpenChange">...</Modal>
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
### usePagination
|
|
875
|
+
|
|
876
|
+
```ts
|
|
877
|
+
import { usePagination } from '@auronui/vue'
|
|
878
|
+
|
|
879
|
+
const { page, totalPages, nextPage, prevPage, goToPage, isFirst, isLast } = usePagination({
|
|
880
|
+
totalItems: 200,
|
|
881
|
+
pageSize: 10,
|
|
882
|
+
defaultPage: 1,
|
|
883
|
+
})
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
```html
|
|
887
|
+
<Pagination :page="page.value" :total="totalPages.value" @change="goToPage" />
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
### useStepper
|
|
891
|
+
|
|
892
|
+
```ts
|
|
893
|
+
import { useStepper } from '@auronui/vue'
|
|
894
|
+
|
|
895
|
+
const { step, nextStep, prevStep, goToStep, isFirst, isLast, getStepStatus, reset } = useStepper({
|
|
896
|
+
steps: ['Account', 'Profile', 'Review'],
|
|
897
|
+
defaultStep: 1,
|
|
898
|
+
})
|
|
899
|
+
```
|
|
900
|
+
|
|
901
|
+
### useTabs
|
|
902
|
+
|
|
903
|
+
```ts
|
|
904
|
+
import { useTabs } from '@auronui/vue'
|
|
905
|
+
|
|
906
|
+
const { activeTab, setTab, onTabChange } = useTabs({ defaultTab: 'overview' })
|
|
907
|
+
```
|
|
908
|
+
|
|
909
|
+
```html
|
|
910
|
+
<Tabs :default-value="activeTab.value" @update:model-value="onTabChange">...</Tabs>
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
### useAccordion
|
|
914
|
+
|
|
915
|
+
```ts
|
|
916
|
+
import { useAccordion } from '@auronui/vue'
|
|
917
|
+
|
|
918
|
+
// Single mode
|
|
919
|
+
const { expanded, toggle, collapseAll } = useAccordion({ type: 'single', collapsible: true })
|
|
920
|
+
|
|
921
|
+
// Multiple mode
|
|
922
|
+
const { expanded, toggle, expandAll, collapseAll } = useAccordion({
|
|
923
|
+
type: 'multiple',
|
|
924
|
+
defaultExpanded: ['item-1'],
|
|
925
|
+
})
|
|
926
|
+
```
|
|
927
|
+
|
|
928
|
+
### useSlider
|
|
929
|
+
|
|
930
|
+
```ts
|
|
931
|
+
import { useSlider } from '@auronui/vue'
|
|
932
|
+
|
|
933
|
+
// Single thumb
|
|
934
|
+
const { value, setValue } = useSlider({ defaultValue: 50, min: 0, max: 100 })
|
|
935
|
+
|
|
936
|
+
// Range (two thumbs)
|
|
937
|
+
const { value, setValue } = useSlider({ defaultValue: [20, 80], min: 0, max: 100 })
|
|
938
|
+
```
|
|
939
|
+
|
|
940
|
+
### useListBox
|
|
941
|
+
|
|
942
|
+
```ts
|
|
943
|
+
import { useListBox } from '@auronui/vue'
|
|
944
|
+
|
|
945
|
+
const { selected, select, deselect, toggle, selectAll, deselectAll } = useListBox({
|
|
946
|
+
multiple: true,
|
|
947
|
+
defaultSelected: new Set(['a']),
|
|
948
|
+
})
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
### useCheckboxGroup
|
|
952
|
+
|
|
953
|
+
```ts
|
|
954
|
+
import { useCheckboxGroup } from '@auronui/vue'
|
|
955
|
+
|
|
956
|
+
const { values, toggle, isChecked, isIndeterminate, isAllChecked, checkAll, uncheckAll } =
|
|
957
|
+
useCheckboxGroup({
|
|
958
|
+
options: ['red', 'green', 'blue'],
|
|
959
|
+
defaultValues: ['red'],
|
|
960
|
+
})
|
|
961
|
+
```
|
|
962
|
+
|
|
963
|
+
### useRadioGroup
|
|
964
|
+
|
|
965
|
+
```ts
|
|
966
|
+
import { useRadioGroup } from '@auronui/vue'
|
|
967
|
+
|
|
968
|
+
const { value, setValue, clear } = useRadioGroup({ defaultValue: 'option-a' })
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
### useCalendar
|
|
972
|
+
|
|
973
|
+
```ts
|
|
974
|
+
import { useCalendar } from '@auronui/vue'
|
|
975
|
+
import { today, getLocalTimeZone } from '@internationalized/date'
|
|
976
|
+
|
|
977
|
+
const { value, setValue, displayMonth, nextMonth, prevMonth, isDisabled } = useCalendar({
|
|
978
|
+
defaultValue: today(getLocalTimeZone()),
|
|
979
|
+
})
|
|
980
|
+
```
|
|
981
|
+
|
|
982
|
+
### useRangeCalendar
|
|
983
|
+
|
|
984
|
+
```ts
|
|
985
|
+
import { useRangeCalendar } from '@auronui/vue'
|
|
986
|
+
|
|
987
|
+
const { start, end, setRange, isComplete, clearRange } = useRangeCalendar()
|
|
988
|
+
// start / end are ComputedRef<DateValue | undefined>
|
|
989
|
+
// isComplete is true when both start and end are set
|
|
990
|
+
```
|
|
991
|
+
|
|
992
|
+
### useTree
|
|
993
|
+
|
|
994
|
+
```ts
|
|
995
|
+
import { useTree } from '@auronui/vue'
|
|
996
|
+
|
|
997
|
+
const { selected, expanded, select, deselect, expand, collapse, expandAll, collapseAll } =
|
|
998
|
+
useTree({ defaultSelected: new Set(['node-1']), multiple: false })
|
|
999
|
+
```
|
|
1000
|
+
|
|
1001
|
+
### useSplitter
|
|
1002
|
+
|
|
1003
|
+
```ts
|
|
1004
|
+
import { useSplitter } from '@auronui/vue'
|
|
1005
|
+
|
|
1006
|
+
const { sizes, setSizes, resetSizes, onLayout } = useSplitter({ defaultSizes: [30, 70] })
|
|
1007
|
+
```
|
|
1008
|
+
|
|
1009
|
+
```html
|
|
1010
|
+
<SplitterGroup @layout="onLayout">
|
|
1011
|
+
<SplitterPanel :default-size="sizes[0]" />
|
|
1012
|
+
<SplitterResizeHandle />
|
|
1013
|
+
<SplitterPanel :default-size="sizes[1]" />
|
|
1014
|
+
</SplitterGroup>
|
|
1015
|
+
```
|
|
1016
|
+
|
|
1017
|
+
### useColorPicker
|
|
1018
|
+
|
|
1019
|
+
```ts
|
|
1020
|
+
import { useColorPicker } from '@auronui/vue'
|
|
1021
|
+
|
|
1022
|
+
const { color, setColor, hue, saturation, brightness, alpha, toHex, toRgb, toHsl } =
|
|
1023
|
+
useColorPicker({ defaultValue: '#3b82f6' })
|
|
1024
|
+
|
|
1025
|
+
console.log(toHex()) // '#3b82f6'
|
|
1026
|
+
console.log(hue.value) // 217
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
```html
|
|
1030
|
+
<ColorPicker v-model="color" @update:model-value="onColorChange" />
|
|
1031
|
+
```
|
|
1032
|
+
|
|
1033
|
+
### useOTP
|
|
1034
|
+
|
|
1035
|
+
```ts
|
|
1036
|
+
import { useOTP } from '@auronui/vue'
|
|
1037
|
+
|
|
1038
|
+
const { value, isComplete, reset, onValueChange, onOTPComplete } = useOTP({
|
|
1039
|
+
length: 6,
|
|
1040
|
+
onComplete: (code) => verifyCode(code),
|
|
1041
|
+
})
|
|
1042
|
+
```
|
|
1043
|
+
|
|
1044
|
+
```html
|
|
1045
|
+
<InputOTP :model-value="value.value" @update:model-value="onValueChange" @complete="onOTPComplete" />
|
|
1046
|
+
```
|
|
1047
|
+
|
|
1048
|
+
### useSwatchPicker
|
|
1049
|
+
|
|
1050
|
+
```ts
|
|
1051
|
+
import { useSwatchPicker } from '@auronui/vue'
|
|
1052
|
+
|
|
1053
|
+
const { selectedColor, hasSelection, setColor, clearSelection, isSelected, onColorChange } =
|
|
1054
|
+
useSwatchPicker({ defaultValue: '#ff0000' })
|
|
1055
|
+
```
|
|
1056
|
+
|
|
1057
|
+
```html
|
|
1058
|
+
<ColorSwatchPicker :model-value="selectedColor.value" @update:model-value="onColorChange" />
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
---
|
|
1062
|
+
|
|
850
1063
|
## Imports
|
|
851
1064
|
|
|
852
1065
|
```ts
|
|
@@ -867,6 +1080,10 @@ import {
|
|
|
867
1080
|
Accordion, AccordionItem, AccordionHeader, AccordionTrigger, AccordionContent,
|
|
868
1081
|
Alert, AlertIcon, AlertTitle, AlertDescription,
|
|
869
1082
|
ToastProvider, Toast, ToastViewport, useToast,
|
|
1083
|
+
useDisclosure, usePagination, useStepper, useTabs, useAccordion,
|
|
1084
|
+
useSlider, useListBox, useCheckboxGroup, useRadioGroup,
|
|
1085
|
+
useCalendar, useRangeCalendar, useTree, useSplitter,
|
|
1086
|
+
useColorPicker, useColorState, useOTP, useSwatchPicker,
|
|
870
1087
|
Badge, Chip, Avatar, AvatarGroup, Card, CardHeader, CardBody, CardFooter,
|
|
871
1088
|
Spinner, Skeleton, Separator, Text, Label, Kbd,
|
|
872
1089
|
Pagination, PaginationContent, PaginationItem, PaginationPrev, PaginationNext,
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -18360,7 +18360,7 @@ var Select_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
18360
18360
|
const triggerId = (0, vue.computed)(() => attrs.id ?? generatedId);
|
|
18361
18361
|
const hasLabel = (0, vue.computed)(() => !!props.label);
|
|
18362
18362
|
const slots = (0, vue.useSlots)();
|
|
18363
|
-
const usesCustomChrome = (0, vue.computed)(() => hasSlotComponent(slots.default?.(), [SelectTrigger_default, SelectContent_default]));
|
|
18363
|
+
const usesCustomChrome = (0, vue.computed)(() => hasSlotComponent(slots.default?.({}), [SelectTrigger_default, SelectContent_default]));
|
|
18364
18364
|
const descriptionId = (0, vue.computed)(() => `${triggerId.value}-description`);
|
|
18365
18365
|
const errorMessageId = (0, vue.computed)(() => `${triggerId.value}-error`);
|
|
18366
18366
|
const showError = (0, vue.computed)(() => props.isInvalid && !!props.errorMessage);
|
|
@@ -19957,7 +19957,7 @@ var ComboBox_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
19957
19957
|
const emit = __emit;
|
|
19958
19958
|
const labelId = (0, vue.useId)();
|
|
19959
19959
|
const slots = (0, vue.useSlots)();
|
|
19960
|
-
const usesCustomChrome = (0, vue.computed)(() => hasSlotComponent(slots.default?.(), [ComboBoxInput_default, ComboBoxContent_default]));
|
|
19960
|
+
const usesCustomChrome = (0, vue.computed)(() => hasSlotComponent(slots.default?.({}), [ComboBoxInput_default, ComboBoxContent_default]));
|
|
19961
19961
|
const slotFns = (0, vue.computed)(() => (0, _auronui_styles.comboBoxVariants)({ fullWidth: props.fullWidth }));
|
|
19962
19962
|
const effectiveFilter = (0, vue.computed)(() => {
|
|
19963
19963
|
if (props.filterFunction) return props.filterFunction;
|
|
@@ -20936,7 +20936,7 @@ var Autocomplete_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
20936
20936
|
const inputId = (0, vue.computed)(() => attrs.id ?? generatedId);
|
|
20937
20937
|
const hasLabel = (0, vue.computed)(() => !!props.label);
|
|
20938
20938
|
const slots = (0, vue.useSlots)();
|
|
20939
|
-
const usesCustomChrome = (0, vue.computed)(() => hasSlotComponent(slots.default?.(), [AutocompleteInput_default, AutocompleteContent_default]));
|
|
20939
|
+
const usesCustomChrome = (0, vue.computed)(() => hasSlotComponent(slots.default?.({}), [AutocompleteInput_default, AutocompleteContent_default]));
|
|
20940
20940
|
const slotItemRegistry = (0, vue.ref)(/* @__PURE__ */ new Map());
|
|
20941
20941
|
function registerItem(value, label) {
|
|
20942
20942
|
const next = new Map(slotItemRegistry.value);
|