neba 1.10.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -6
- package/dist/components/accordion/Accordion.js +1 -1
- package/dist/components/alert/Alert.js +1 -1
- package/dist/components/anchor/Anchor.js +1 -1
- package/dist/components/animate-appear/AnimateAppear.d.ts +2 -13
- package/dist/components/animate-appear/AnimateAppear.js +1 -1
- package/dist/components/animate-blink/AnimateBlink.d.ts +2 -2
- package/dist/components/animate-blink/AnimateBlink.js +1 -1
- package/dist/components/animate-counter/AnimateCounter.d.ts +45 -0
- package/dist/components/animate-counter/AnimateCounter.js +1 -0
- package/dist/components/animate-counter/index.d.ts +1 -0
- package/dist/components/animate-counter/index.js +1 -0
- package/dist/components/animate-fade/AnimateFade.d.ts +2 -2
- package/dist/components/animate-fade/AnimateFade.js +1 -1
- package/dist/components/animate-float/AnimateFloat.d.ts +35 -0
- package/dist/components/animate-float/AnimateFloat.js +1 -0
- package/dist/components/animate-float/index.d.ts +1 -0
- package/dist/components/animate-float/index.js +1 -0
- package/dist/components/animate-grow/AnimateGrow.d.ts +2 -2
- package/dist/components/animate-grow/AnimateGrow.js +1 -1
- package/dist/components/animate-lighting/AnimateLighting.js +1 -1
- package/dist/components/animate-reveal/AnimateReveal.d.ts +41 -0
- package/dist/components/animate-reveal/AnimateReveal.js +1 -0
- package/dist/components/animate-reveal/index.d.ts +1 -0
- package/dist/components/animate-reveal/index.js +1 -0
- package/dist/components/animate-rotate/AnimateRotate.d.ts +2 -2
- package/dist/components/animate-rotate/AnimateRotate.js +1 -1
- package/dist/components/animate-scramble/AnimateScramble.d.ts +48 -0
- package/dist/components/animate-scramble/AnimateScramble.js +1 -0
- package/dist/components/animate-scramble/index.d.ts +1 -0
- package/dist/components/animate-scramble/index.js +1 -0
- package/dist/components/animate-shake/AnimateShake.d.ts +39 -0
- package/dist/components/animate-shake/AnimateShake.js +1 -0
- package/dist/components/animate-shake/index.d.ts +1 -0
- package/dist/components/animate-shake/index.js +1 -0
- package/dist/components/animate-slide/AnimateSlide.d.ts +2 -2
- package/dist/components/animate-slide/AnimateSlide.js +1 -1
- package/dist/components/animate-split/AnimateSplit.d.ts +61 -0
- package/dist/components/animate-split/AnimateSplit.js +1 -0
- package/dist/components/animate-split/index.d.ts +1 -0
- package/dist/components/animate-split/index.js +1 -0
- package/dist/components/animate-typing/AnimateTyping.js +1 -1
- package/dist/components/animate-zoom/AnimateZoom.d.ts +2 -2
- package/dist/components/animate-zoom/AnimateZoom.js +1 -1
- package/dist/components/app-logo/AppLogo.js +1 -1
- package/dist/components/aspect-ratio/AspectRatio.js +1 -1
- package/dist/components/avatar/Avatar.js +1 -1
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/bar-chart/BarChart.d.ts +1 -1
- package/dist/components/bar-chart/BarChart.js +1 -1
- package/dist/components/blockquote/Blockquote.js +1 -1
- package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
- package/dist/components/box/Box.js +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/button-group/ButtonGroup.js +1 -1
- package/dist/components/calendar/Calendar.d.ts +72 -0
- package/dist/components/calendar/Calendar.js +1 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/card/Card.js +1 -1
- package/dist/components/carousel/Carousel.js +1 -1
- package/dist/components/chat-bubble/ChatBubble.js +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/chip/Chip.js +1 -1
- package/dist/components/code-block/CodeBlock.js +1 -1
- package/dist/components/collapsible/Collapsible.js +1 -1
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/combobox/Combobox.d.ts +14 -2
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/command-palette/CommandPalette.d.ts +1 -1
- package/dist/components/command-palette/CommandPalette.js +1 -1
- package/dist/components/confirm/Confirm.d.ts +83 -0
- package/dist/components/confirm/Confirm.js +1 -0
- package/dist/components/confirm/index.d.ts +2 -0
- package/dist/components/confirm/index.js +1 -0
- package/dist/components/container/Container.d.ts +12 -4
- package/dist/components/container/Container.js +1 -1
- package/dist/components/data-list/DataList.js +1 -1
- package/dist/components/data-table/DataTable.d.ts +104 -1
- package/dist/components/data-table/DataTable.js +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +40 -8
- package/dist/components/date-picker/DatePicker.js +1 -1
- package/dist/components/date-range-picker/DateRangePicker.js +1 -1
- package/dist/components/date-time-picker/DateTimePicker.js +1 -1
- package/dist/components/dialog/Dialog.d.ts +1 -1
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/divider/Divider.js +1 -1
- package/dist/components/drawer/Drawer.d.ts +1 -1
- package/dist/components/drawer/Drawer.js +1 -1
- package/dist/components/empty/Empty.js +1 -1
- package/dist/components/file-picker/FilePicker.js +1 -1
- package/dist/components/flex/Flex.d.ts +93 -0
- package/dist/components/flex/Flex.js +1 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +1 -0
- package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
- package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.js +1 -1
- package/dist/components/footer/Footer.d.ts +4 -3
- package/dist/components/footer/Footer.js +1 -1
- package/dist/components/gallery/Gallery.d.ts +150 -0
- package/dist/components/gallery/Gallery.js +1 -0
- package/dist/components/gallery/GalleryViewer.d.ts +30 -0
- package/dist/components/gallery/GalleryViewer.js +1 -0
- package/dist/components/gallery/index.d.ts +2 -0
- package/dist/components/gallery/index.js +1 -0
- package/dist/components/gauge-chart/GaugeChart.d.ts +1 -1
- package/dist/components/gauge-chart/GaugeChart.js +1 -1
- package/dist/components/grid/Grid.js +1 -1
- package/dist/components/grid-container/GridContainer.js +1 -1
- package/dist/components/header/Header.d.ts +5 -4
- package/dist/components/header/Header.js +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.d.ts +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
- package/dist/components/highlight/Highlight.js +1 -1
- package/dist/components/hover-card/HoverCard.d.ts +1 -1
- package/dist/components/hover-card/HoverCard.js +1 -1
- package/dist/components/how-to-steps/HowToSteps.js +1 -1
- package/dist/components/image/Image.d.ts +190 -0
- package/dist/components/image/Image.js +1 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/image/index.js +1 -0
- package/dist/components/list/List.js +1 -1
- package/dist/components/menu/Menu.js +1 -1
- package/dist/components/menubar/Menubar.js +1 -1
- package/dist/components/meter/Meter.js +1 -1
- package/dist/components/mockup/Mockup.js +1 -1
- package/dist/components/navigation-menu/NavigationMenu.js +1 -1
- package/dist/components/number-field/NumberField.d.ts +12 -2
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/otp-field/OtpField.js +1 -1
- package/dist/components/overlay/Overlay.d.ts +1 -1
- package/dist/components/overlay/Overlay.js +1 -1
- package/dist/components/page-layout/PageLayout.js +1 -1
- package/dist/components/pagination/Pagination.js +1 -1
- package/dist/components/panes/Panes.js +1 -1
- package/dist/components/pie-chart/PieChart.d.ts +1 -1
- package/dist/components/pie-chart/PieChart.js +1 -1
- package/dist/components/pill/Pill.js +1 -1
- package/dist/components/popconfirm/Popconfirm.d.ts +71 -0
- package/dist/components/popconfirm/Popconfirm.js +1 -0
- package/dist/components/popconfirm/index.d.ts +2 -0
- package/dist/components/popconfirm/index.js +1 -0
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/portal/Portal.d.ts +48 -0
- package/dist/components/portal/Portal.js +1 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +1 -0
- package/dist/components/progress-box/ProgressBox.js +1 -1
- package/dist/components/progress-circular/ProgressCircular.js +1 -1
- package/dist/components/progress-linear/ProgressLinear.js +1 -1
- package/dist/components/provider/NebaProvider.d.ts +99 -0
- package/dist/components/provider/NebaProvider.js +1 -0
- package/dist/components/provider/index.d.ts +3 -0
- package/dist/components/provider/index.js +1 -0
- package/dist/components/radio-group/RadioGroup.js +1 -1
- package/dist/components/rating/Rating.js +1 -1
- package/dist/components/scatter-chart/ScatterChart.d.ts +1 -1
- package/dist/components/scatter-chart/ScatterChart.js +1 -1
- package/dist/components/scroll-area/ScrollArea.js +1 -1
- package/dist/components/scroll-zone/ScrollZone.d.ts +9 -4
- package/dist/components/scroll-zone/ScrollZone.js +1 -1
- package/dist/components/select/Select.js +1 -1
- package/dist/components/shortcut/Shortcut.d.ts +2 -1
- package/dist/components/shortcut/Shortcut.js +1 -1
- package/dist/components/show/Show.d.ts +60 -0
- package/dist/components/show/Show.js +1 -0
- package/dist/components/show/index.d.ts +2 -0
- package/dist/components/show/index.js +1 -0
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/sidebar/SidebarTrigger.js +1 -1
- package/dist/components/skeleton/Skeleton.js +1 -1
- package/dist/components/slider/Slider.js +1 -1
- package/dist/components/sparkline/Sparkline.js +1 -1
- package/dist/components/spoiler/Spoiler.js +1 -1
- package/dist/components/stack/Stack.d.ts +126 -0
- package/dist/components/stack/Stack.js +1 -0
- package/dist/components/stack/index.d.ts +1 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/statistic/Statistic.d.ts +8 -3
- package/dist/components/statistic/Statistic.js +1 -1
- package/dist/components/switch/Switch.js +1 -1
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/Table.js +1 -1
- package/dist/components/tabs/Tabs.d.ts +28 -0
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/text-field/TextField.d.ts +12 -1
- package/dist/components/text-field/TextField.js +1 -1
- package/dist/components/text-link/TextLink.js +1 -1
- package/dist/components/time-picker/TimePicker.js +1 -1
- package/dist/components/timeline-chart/TimelineChart.d.ts +1 -1
- package/dist/components/timeline-chart/TimelineChart.js +1 -1
- package/dist/components/toast/Toast.d.ts +1 -1
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/toggle/Toggle.js +1 -1
- package/dist/components/toggle-group/ToggleGroup.js +1 -1
- package/dist/components/toolbar/Toolbar.js +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.js +1 -1
- package/dist/components/tour/Tour.d.ts +1 -1
- package/dist/components/tour/Tour.js +1 -1
- package/dist/components/transfer/Transfer.js +1 -1
- package/dist/components/tree-select/TreeSelect.d.ts +88 -0
- package/dist/components/tree-select/TreeSelect.js +1 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +1 -0
- package/dist/components/tree-view/TreeView.js +1 -1
- package/dist/components/visually-hidden/VisuallyHidden.d.ts +37 -0
- package/dist/components/visually-hidden/VisuallyHidden.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +1 -0
- package/dist/components/window-pane/WindowPane.js +1 -1
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useDisclosure.d.ts +21 -0
- package/dist/hooks/useDisclosure.js +1 -0
- package/dist/hooks/useElementSize.d.ts +23 -0
- package/dist/hooks/useElementSize.js +1 -0
- package/dist/hooks/useMediaQuery.d.ts +61 -0
- package/dist/hooks/useMediaQuery.js +1 -0
- package/dist/hooks/useOnScreen.d.ts +24 -0
- package/dist/hooks/useOnScreen.js +1 -0
- package/dist/hooks/useShortcut.d.ts +34 -0
- package/dist/hooks/useShortcut.js +1 -0
- package/dist/index.d.ts +19 -1
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +65 -2
- package/dist/internal/animate.js +1 -1
- package/dist/internal/calendar.d.ts +31 -5
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +32 -0
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/chart.d.ts +16 -0
- package/dist/internal/chart.js +1 -1
- package/dist/internal/csv.d.ts +40 -0
- package/dist/internal/csv.js +1 -0
- package/dist/internal/date.d.ts +39 -1
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +46 -0
- package/dist/internal/defaults.js +1 -0
- package/dist/internal/grid.d.ts +13 -27
- package/dist/internal/grid.js +1 -1
- package/dist/internal/i18n.d.ts +43 -0
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/keys.d.ts +92 -0
- package/dist/internal/keys.js +1 -0
- package/dist/internal/media.d.ts +34 -0
- package/dist/internal/media.js +1 -1
- package/dist/internal/page-layout.d.ts +18 -9
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +7 -1
- package/dist/internal/picker.js +1 -1
- package/dist/internal/responsive.d.ts +97 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/styles.d.ts +68 -0
- package/dist/internal/styles.js +1 -1
- package/dist/internal/text.d.ts +42 -0
- package/dist/internal/text.js +1 -0
- package/dist/locales/ar.js +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/hi.js +1 -1
- package/dist/locales/id.js +1 -1
- package/dist/locales/it.js +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/nl.js +1 -1
- package/dist/locales/pl.js +1 -1
- package/dist/locales/pt.js +1 -1
- package/dist/locales/ru.js +1 -1
- package/dist/locales/th.js +1 -1
- package/dist/locales/tr.js +1 -1
- package/dist/locales/vi.js +1 -1
- package/dist/locales/zh-hans.js +1 -1
- package/dist/locales/zh-hant.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +280 -24
- package/dist/types.d.ts +153 -6
- package/package.json +23 -17
- package/dist/components/avatar-group/AvatarGroup.d.ts +0 -47
- package/dist/components/avatar-group/AvatarGroup.js +0 -1
- package/dist/components/avatar-group/index.d.ts +0 -2
- package/dist/components/avatar-group/index.js +0 -1
- package/dist/internal/avatar-group.d.ts +0 -22
- package/dist/internal/avatar-group.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neba",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "A comprehensive React UI component library — buttons, fields, menus, dialogs, tables and much more — accessible and themeable, sharing one prop vocabulary and a translucent acrylic design language. ESM only, types included, dark mode built in.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"url": "https://github.com/jooy2/neba/issues"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"
|
|
21
|
+
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
22
|
+
"build": "npm run clean && npm run format:fix && tsc --project tsconfig.prod.json && node scripts/annotate-pure.mjs && npm run minify && node scripts/build-styles.mjs",
|
|
22
23
|
"lint": "eslint . --report-unused-disable-directives",
|
|
23
24
|
"lint:fix": "eslint . --report-unused-disable-directives --fix",
|
|
24
25
|
"minify": "terser-glob 'dist/**/*.js' --config-file terser.config.json",
|
|
@@ -29,9 +30,9 @@
|
|
|
29
30
|
"format:fix": "prettier . --write",
|
|
30
31
|
"docs:changelog": "node scripts/copy-changelog.mjs",
|
|
31
32
|
"docs:dev": "npm run docs:changelog && vitepress dev docs",
|
|
32
|
-
"docs:build": "npm run docs:changelog && vitepress build docs",
|
|
33
|
+
"docs:build": "npm run docs:changelog && node --max-old-space-size=8192 ./node_modules/vitepress/bin/vitepress.js build docs",
|
|
33
34
|
"docs:serve": "npm run docs:build && vitepress serve docs",
|
|
34
|
-
"test": "
|
|
35
|
+
"test": "node scripts/run-tests.mjs",
|
|
35
36
|
"test:watch": "vitest",
|
|
36
37
|
"typecheck": "tsc --project tsconfig.prod.json --noEmit && tsc --project test/tsconfig.json && tsc --project docs/tsconfig.json"
|
|
37
38
|
},
|
|
@@ -50,6 +51,11 @@
|
|
|
50
51
|
"module": "./dist/types.js",
|
|
51
52
|
"default": "./dist/types.js"
|
|
52
53
|
},
|
|
54
|
+
"./hooks": {
|
|
55
|
+
"types": "./dist/hooks/index.d.ts",
|
|
56
|
+
"module": "./dist/hooks/index.js",
|
|
57
|
+
"default": "./dist/hooks/index.js"
|
|
58
|
+
},
|
|
53
59
|
"./locales": {
|
|
54
60
|
"types": "./dist/locales/index.d.ts",
|
|
55
61
|
"module": "./dist/locales/index.js",
|
|
@@ -133,21 +139,21 @@
|
|
|
133
139
|
"devDependencies": {
|
|
134
140
|
"@eslint/js": "^9.39.1",
|
|
135
141
|
"@tailwindcss/postcss": "^4.3.3",
|
|
136
|
-
"@types/node": "^26.4.
|
|
142
|
+
"@types/node": "^26.4.1",
|
|
137
143
|
"@types/react": "^19.2.18",
|
|
138
|
-
"@types/react-dom": "^19.2.
|
|
139
|
-
"@typescript-eslint/parser": "^8.
|
|
144
|
+
"@types/react-dom": "^19.2.7",
|
|
145
|
+
"@typescript-eslint/parser": "^8.69.0",
|
|
140
146
|
"@vitejs/plugin-react": "^6.1.1",
|
|
141
|
-
"@vitest/browser": "^
|
|
142
|
-
"@vitest/browser-playwright": "^
|
|
147
|
+
"@vitest/browser": "^5.0.0",
|
|
148
|
+
"@vitest/browser-playwright": "^5.0.0",
|
|
143
149
|
"eslint": "^9.39.1",
|
|
144
150
|
"eslint-config-prettier": "^10.1.8",
|
|
145
151
|
"eslint-plugin-n": "^18.3.0",
|
|
146
152
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
147
|
-
"globals": "^17.
|
|
153
|
+
"globals": "^17.12.0",
|
|
148
154
|
"jiti": "^2.7.0",
|
|
149
|
-
"playwright": "^1.
|
|
150
|
-
"postcss": "^8.5.
|
|
155
|
+
"playwright": "^1.63.0",
|
|
156
|
+
"postcss": "^8.5.28",
|
|
151
157
|
"prettier": "^3.9.6",
|
|
152
158
|
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
153
159
|
"react": "^19.2.8",
|
|
@@ -156,16 +162,16 @@
|
|
|
156
162
|
"terser-glob": "^1.2.1",
|
|
157
163
|
"tsx": "^4.23.13",
|
|
158
164
|
"typescript": "^6.0.3",
|
|
159
|
-
"typescript-eslint": "^8.
|
|
165
|
+
"typescript-eslint": "^8.69.0",
|
|
160
166
|
"vite": "^8.2.2",
|
|
161
167
|
"vitepress": "^1.6.4",
|
|
162
168
|
"vitepress-i18n": "^1.4.0",
|
|
163
|
-
"vitepress-sidebar": "^1.
|
|
164
|
-
"vitest": "^
|
|
165
|
-
"vitest-browser-react": "^2.
|
|
169
|
+
"vitepress-sidebar": "^1.40.0",
|
|
170
|
+
"vitest": "^5.0.0",
|
|
171
|
+
"vitest-browser-react": "^2.3.0"
|
|
166
172
|
},
|
|
167
173
|
"dependencies": {
|
|
168
|
-
"@base-ui/react": "^1.
|
|
174
|
+
"@base-ui/react": "^1.8.0",
|
|
169
175
|
"highlight.js": "^11.12.0"
|
|
170
176
|
},
|
|
171
177
|
"peerDependencies": {
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type AvatarShape } from '../avatar/Avatar.js';
|
|
3
|
-
import type { NebaColor, NebaElevation, NebaSize, NebaVariant } from '../../types.js';
|
|
4
|
-
export interface AvatarGroupProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
5
|
-
/**
|
|
6
|
-
* How many avatars are drawn before the rest become a count. Left out, every
|
|
7
|
-
* one of them is drawn.
|
|
8
|
-
*/
|
|
9
|
-
max?: number;
|
|
10
|
-
/**
|
|
11
|
-
* How many there are altogether, when the group was handed only the first
|
|
12
|
-
* few. Without it the count is worked out from the children, which is right
|
|
13
|
-
* only when all of them were passed.
|
|
14
|
-
*/
|
|
15
|
-
total?: number;
|
|
16
|
-
/**
|
|
17
|
-
* How far each avatar sits under the one before it — a CSS length, or a
|
|
18
|
-
* number of pixels. Left out it is a fraction of `size`, which keeps the
|
|
19
|
-
* overlap looking the same at every step.
|
|
20
|
-
*/
|
|
21
|
-
overlap?: number | string;
|
|
22
|
-
/** Passed to every avatar in the group. @default 'md' */
|
|
23
|
-
size?: NebaSize;
|
|
24
|
-
/** Passed to every avatar in the group. @default 'circle' */
|
|
25
|
-
shape?: AvatarShape;
|
|
26
|
-
/** Passed to every avatar in the group. @default 'text' */
|
|
27
|
-
variant?: NebaVariant;
|
|
28
|
-
/** Passed to every avatar in the group. @default 'primary' */
|
|
29
|
-
color?: NebaColor;
|
|
30
|
-
/** Passed to every avatar in the group. @default 0 */
|
|
31
|
-
elevation?: NebaElevation;
|
|
32
|
-
/** The avatars. */
|
|
33
|
-
children?: React.ReactNode;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* A stack of avatars, overlapping, with the ones that did not fit as a count.
|
|
37
|
-
*
|
|
38
|
-
* `size`, `shape`, `variant`, `color` and `elevation` are set once here rather
|
|
39
|
-
* than on every avatar — a stack whose fourth face is a size out is not a stack
|
|
40
|
-
* — and an avatar's own prop still wins, which is what lets one of them be
|
|
41
|
-
* marked out from the rest.
|
|
42
|
-
*
|
|
43
|
-
* The order is the DOM order, and the first avatar is on top: a stack read
|
|
44
|
-
* left to right is read front to back, so the one the group is *about* comes
|
|
45
|
-
* first rather than last.
|
|
46
|
-
*/
|
|
47
|
-
export declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as e}from"react/jsx-runtime";import*as a from"react";import{Avatar as t}from"../avatar/Avatar.js";import{AvatarGroupContext as i}from"../../internal/avatar-group.js";import{cx as n}from"../../internal/styles.js";const l={xs:"0.375rem",sm:"0.5rem",md:"0.625rem",lg:"0.75rem",xl:"0.875rem"};export const AvatarGroup=/*@__PURE__*/a.forwardRef(function({max:o,total:s,overlap:m,size:c="md",shape:v="circle",variant:p="text",color:f="primary",elevation:d=0,className:x,style:h,children:u,...g},j){const y=a.useMemo(()=>({size:c,shape:v,variant:p,color:f,elevation:d}),[c,v,p,f,d]),A=a.Children.toArray(u),M=void 0===o?A:A.slice(0,Math.max(0,o)),b=s??A.length,z=Math.max(0,b-M.length);return r(i.Provider,{value:y,children:e("div",{ref:j,className:n("isolate inline-flex items-center","[&>*:not(:first-child)]:[margin-inline-start:calc(var(--n-overlap)*-1)]","[&>*]:ring-2 [&>*]:ring-(--neba-surface)",x??""),style:{"--n-overlap":void 0===m?l[c]:"number"==typeof m?`${m}px`:m,...h},...g,children:[M,z>0?r(t,{initials:`+${z}`}):null]})})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{AvatarGroup}from"./AvatarGroup.js";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { AvatarShape } from '../components/avatar/Avatar.js';
|
|
3
|
-
import type { NebaColor, NebaElevation, NebaSize, NebaVariant } from '../types.js';
|
|
4
|
-
/**
|
|
5
|
-
* What an Avatar inherits from the AvatarGroup around it.
|
|
6
|
-
*
|
|
7
|
-
* `button-group.ts`'s arrangement, one component over and for the same reason:
|
|
8
|
-
* a stack of avatars where the fourth one is a size out is not a stack, and
|
|
9
|
-
* `React.Children.map` with `cloneElement` stops working the moment a caller
|
|
10
|
-
* wraps one of them in a Tooltip or produces them from a `.map()`.
|
|
11
|
-
*
|
|
12
|
-
* It lives here rather than in the avatar-group folder so that Avatar can read
|
|
13
|
-
* it without the two components importing each other.
|
|
14
|
-
*/
|
|
15
|
-
export interface AvatarGroupContextValue {
|
|
16
|
-
size?: NebaSize;
|
|
17
|
-
shape?: AvatarShape;
|
|
18
|
-
variant?: NebaVariant;
|
|
19
|
-
color?: NebaColor;
|
|
20
|
-
elevation?: NebaElevation;
|
|
21
|
-
}
|
|
22
|
-
export declare const AvatarGroupContext: React.Context<AvatarGroupContextValue | null>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import*as t from"react";export const AvatarGroupContext=/*@__PURE__*/t.createContext(null);
|