neba 1.11.0 → 1.13.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/LICENSE +1 -1
- package/README.md +43 -41
- package/dist/components/accordion/Accordion.d.ts +18 -0
- package/dist/components/accordion/Accordion.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-marquee/AnimateMarquee.d.ts +5 -3
- package/dist/components/animate-marquee/AnimateMarquee.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/avatar/Avatar.js +1 -1
- package/dist/components/bar-chart/BarChart.js +1 -1
- package/dist/components/bottom-navigation/BottomNavigation.d.ts +10 -0
- package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/calendar/Calendar.js +1 -1
- package/dist/components/carousel/Carousel.d.ts +13 -0
- package/dist/components/carousel/Carousel.js +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/code-block/CodeBlock.js +1 -1
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/combobox/Combobox.d.ts +18 -0
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/command-palette/CommandPalette.js +1 -1
- package/dist/components/container/Container.d.ts +12 -4
- package/dist/components/container/Container.js +1 -1
- package/dist/components/data-table/DataTable.js +1 -1
- 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.js +1 -1
- package/dist/components/drawer/Drawer.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/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.js +1 -1
- package/dist/components/grid/Grid.d.ts +11 -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.js +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 +155 -7
- package/dist/components/image/Image.js +1 -1
- package/dist/components/image/index.d.ts +1 -1
- package/dist/components/menu/Menu.js +1 -1
- package/dist/components/meter/Meter.d.ts +7 -0
- package/dist/components/meter/Meter.js +1 -1
- package/dist/components/navigation-menu/NavigationMenu.js +1 -1
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/otp-field/OtpField.js +1 -1
- package/dist/components/overlay/Overlay.js +1 -1
- package/dist/components/panes/Panes.js +1 -1
- package/dist/components/pie-chart/PieChart.js +1 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/progress-circular/ProgressCircular.d.ts +10 -1
- package/dist/components/progress-circular/ProgressCircular.js +1 -1
- package/dist/components/progress-linear/ProgressLinear.d.ts +7 -1
- package/dist/components/progress-linear/ProgressLinear.js +1 -1
- package/dist/components/provider/NebaProvider.js +1 -1
- package/dist/components/radio-group/RadioGroup.js +1 -1
- package/dist/components/rating/Rating.js +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 +17 -11
- package/dist/components/scroll-zone/ScrollZone.js +1 -1
- package/dist/components/select/Select.d.ts +13 -0
- package/dist/components/select/Select.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/slider/Slider.d.ts +37 -2
- package/dist/components/slider/Slider.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/tabs/Tabs.d.ts +46 -0
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/text-field/TextField.js +1 -1
- package/dist/components/time-picker/TimePicker.js +1 -1
- package/dist/components/timeline-chart/TimelineChart.js +1 -1
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/toggle/Toggle.js +1 -1
- package/dist/components/tooltip/Tooltip.js +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 +2 -0
- package/dist/components/tree-select/TreeSelect.js +1 -1
- package/dist/components/tree-view/TreeView.js +1 -1
- package/dist/components/typography/Typography.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useMediaQuery.d.ts +35 -1
- package/dist/hooks/useMediaQuery.js +1 -1
- package/dist/index.d.ts +10 -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/cache.d.ts +24 -0
- package/dist/internal/cache.js +1 -0
- package/dist/internal/calendar.d.ts +15 -42
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +48 -3
- 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/date.js +1 -1
- package/dist/internal/drag.d.ts +8 -6
- package/dist/internal/drag.js +1 -1
- package/dist/internal/format.d.ts +21 -7
- package/dist/internal/format.js +1 -1
- package/dist/internal/grid.d.ts +29 -27
- package/dist/internal/grid.js +1 -1
- package/dist/internal/i18n.d.ts +92 -0
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/icons.d.ts +25 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/link.d.ts +5 -4
- package/dist/internal/media.d.ts +9 -2
- package/dist/internal/media.js +1 -1
- package/dist/internal/observe.js +1 -1
- package/dist/internal/page-layout.d.ts +11 -9
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +8 -3
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +24 -1
- package/dist/internal/progress.js +1 -1
- package/dist/internal/responsive.d.ts +97 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/styles.d.ts +140 -2
- package/dist/internal/styles.js +1 -1
- package/dist/internal/text.d.ts +32 -0
- package/dist/internal/text.js +1 -0
- package/dist/internal/wheel.d.ts +38 -0
- package/dist/internal/wheel.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 +411 -30
- package/dist/types.d.ts +119 -6
- package/package.json +19 -18
- 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/dist/types.d.ts
CHANGED
|
@@ -101,6 +101,23 @@ export type NebaDateGranularity = 'day' | 'month' | 'year';
|
|
|
101
101
|
* `xs` is 0: it is the value with no media query around it.
|
|
102
102
|
*/
|
|
103
103
|
export type NebaBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
104
|
+
/**
|
|
105
|
+
* How wide content is allowed to get.
|
|
106
|
+
*
|
|
107
|
+
* A step of the measure ladder — `xs` 30rem, `sm` 40rem, `md` 48rem, `lg`
|
|
108
|
+
* 64rem, `xl` 80rem — `none` for no limit, or any CSS length the caller writes:
|
|
109
|
+
* `'60ch'`, `'min(90vw, 72rem)'`, or a number, which is pixels.
|
|
110
|
+
*
|
|
111
|
+
* The ladder shares its five names with `NebaBreakpoint` and four of its five
|
|
112
|
+
* values, which is deliberate: `maxWidth="md"` holds the content to the width
|
|
113
|
+
* at which a `md:` variant starts, so the two ladders line up where a layout
|
|
114
|
+
* needs them to. `xs` is the one step that is not a breakpoint floor, because a
|
|
115
|
+
* measure of zero is not a thing.
|
|
116
|
+
*
|
|
117
|
+
* The `string & {}` is what keeps the five names in a caller's autocomplete: a
|
|
118
|
+
* bare `| string` would swallow the literals and offer nothing.
|
|
119
|
+
*/
|
|
120
|
+
export type NebaMeasure = NebaSize | 'none' | number | (string & {});
|
|
104
121
|
/**
|
|
105
122
|
* A value that may differ per breakpoint.
|
|
106
123
|
*
|
|
@@ -145,19 +162,43 @@ export type NebaVariant = 'solid' | 'outline' | 'text';
|
|
|
145
162
|
*/
|
|
146
163
|
export type NebaElevation = 0 | 1 | 2 | 3;
|
|
147
164
|
/**
|
|
148
|
-
* The
|
|
149
|
-
*
|
|
165
|
+
* The seven effects the `transition` prop takes, which is the **entrance**
|
|
166
|
+
* vocabulary: everything a component can be given to arrive on.
|
|
150
167
|
*
|
|
151
168
|
* They are named after what a reader sees rather than after the CSS property
|
|
152
169
|
* underneath: `zoom` and `grow` are both a change of scale, and they are two
|
|
153
170
|
* words because they are two *gestures* — one arrives from the middle of where
|
|
154
171
|
* it will end up, the other unfolds from nothing.
|
|
155
172
|
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
173
|
+
* Two `Animate*` components are deliberately **not** in it, and not only
|
|
174
|
+
* because neither is an entrance. This union is two `Record`s in
|
|
175
|
+
* `internal/animate.tsx`, an object literal cannot be tree-shaken per key, and
|
|
176
|
+
* those two tables are a fixed cost on every component that offers a
|
|
177
|
+
* `transition` — so `AnimateFloat`'s drift, which has no arrival in it, and
|
|
178
|
+
* `AnimateShake`'s reply to a failed form would be paid for by every Chip on
|
|
179
|
+
* every page that draws one. They bring their own keyframe instead.
|
|
180
|
+
*
|
|
181
|
+
* Everything past a keyframe is a component rather than a value. A typewriter,
|
|
182
|
+
* a marquee, a headline reel, a split line, a settling scramble and a counted
|
|
183
|
+
* number all need to know what their children *are*, and a prop that only sets
|
|
184
|
+
* class names cannot.
|
|
185
|
+
*/
|
|
186
|
+
export type NebaAnimation = 'fade' | 'grow' | 'slide' | 'zoom' | 'rotate' | 'blink' | 'reveal';
|
|
187
|
+
/**
|
|
188
|
+
* What drives an animation's progress.
|
|
189
|
+
*
|
|
190
|
+
* - `time` — the clock. The default, and what every other prop on an animation
|
|
191
|
+
* is written against.
|
|
192
|
+
* - `view` — how far the element has travelled through the viewport. The
|
|
193
|
+
* animation has no duration of its own any more: scrolling forwards plays it
|
|
194
|
+
* forwards, scrolling back plays it back, and stopping halfway holds it
|
|
195
|
+
* halfway. `duration`, `delay`, `repeat` and every `trigger` are ignored,
|
|
196
|
+
* because the scroll position *is* the trigger.
|
|
197
|
+
*
|
|
198
|
+
* Where `animation-timeline` is not supported the effect falls back to `time`
|
|
199
|
+
* and runs on mount, which is the same content delivered a plainer way.
|
|
159
200
|
*/
|
|
160
|
-
export type
|
|
201
|
+
export type NebaAnimateTimeline = 'time' | 'view';
|
|
161
202
|
/**
|
|
162
203
|
* What makes an animation run.
|
|
163
204
|
*
|
|
@@ -187,6 +228,43 @@ export type NebaAnimateRepeat = number | 'infinite';
|
|
|
187
228
|
* whose type is `string` invites `'0.4s'`, and then two components in the same
|
|
188
229
|
* screen are written in two units.
|
|
189
230
|
*/
|
|
231
|
+
/**
|
|
232
|
+
* The three props that turn one effect on a box into the same effect on the
|
|
233
|
+
* things inside it, one after another.
|
|
234
|
+
*
|
|
235
|
+
* They are their own bundle rather than part of `NebaAnimateProps` because only
|
|
236
|
+
* some of the eleven can take them. An effect that already has to understand its
|
|
237
|
+
* children — a marquee that duplicates them, a headline that swaps between them,
|
|
238
|
+
* a typewriter that counts characters — has no second axis to spend on order.
|
|
239
|
+
*
|
|
240
|
+
* `delay` and `duration` stay what they were: what *every* child gets. These
|
|
241
|
+
* three are the difference between them.
|
|
242
|
+
*/
|
|
243
|
+
export interface NebaStaggerProps {
|
|
244
|
+
/**
|
|
245
|
+
* How long after one child the next one starts, in milliseconds.
|
|
246
|
+
*
|
|
247
|
+
* `0` — the default everywhere but `AnimateAppear` — animates the box itself
|
|
248
|
+
* and leaves the children alone, which is the plain single-element effect.
|
|
249
|
+
* Anything above it moves the animation onto each child in turn.
|
|
250
|
+
* @default 0
|
|
251
|
+
*/
|
|
252
|
+
stagger?: number;
|
|
253
|
+
/**
|
|
254
|
+
* How much longer each successive child takes than the one before it, in
|
|
255
|
+
* milliseconds. Negative to speed them up down the list.
|
|
256
|
+
*
|
|
257
|
+
* A duration never goes below zero however far the list runs.
|
|
258
|
+
* @default 0
|
|
259
|
+
*/
|
|
260
|
+
durationStep?: number;
|
|
261
|
+
/**
|
|
262
|
+
* Runs the children from the last to the first. Only the *order* reverses —
|
|
263
|
+
* each child still plays forwards.
|
|
264
|
+
* @default false
|
|
265
|
+
*/
|
|
266
|
+
reverse?: boolean;
|
|
267
|
+
}
|
|
190
268
|
export interface NebaAnimateProps {
|
|
191
269
|
/** How long one run takes, in milliseconds. */
|
|
192
270
|
duration?: number;
|
|
@@ -217,6 +295,35 @@ export interface NebaAnimateProps {
|
|
|
217
295
|
*/
|
|
218
296
|
threshold?: number;
|
|
219
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* The two props that swap the clock for the scrollbar.
|
|
300
|
+
*
|
|
301
|
+
* Their own bundle rather than part of `NebaAnimateProps`, for the reason
|
|
302
|
+
* `NebaStaggerProps` is: only the effects whose motion is one `@keyframes` on
|
|
303
|
+
* the element itself can be pointed at another timeline. A marquee that measures
|
|
304
|
+
* its own track, a typewriter counting characters and a light travelling round a
|
|
305
|
+
* pseudo-element are motion written in other places, and offering them a prop
|
|
306
|
+
* that quietly did nothing would be worse than not offering it.
|
|
307
|
+
*/
|
|
308
|
+
export interface NebaTimelineProps {
|
|
309
|
+
/**
|
|
310
|
+
* What drives the progress: the clock, or how far the element has travelled
|
|
311
|
+
* through the viewport.
|
|
312
|
+
*
|
|
313
|
+
* `view` costs `duration`, `delay`, `repeat` and `trigger` — a scroll-driven
|
|
314
|
+
* animation has no time in it, and the scroll position is what starts it. It
|
|
315
|
+
* falls back to `time` where the browser has no `animation-timeline`, which
|
|
316
|
+
* plays the effect once on mount.
|
|
317
|
+
* @default 'time'
|
|
318
|
+
*/
|
|
319
|
+
timeline?: NebaAnimateTimeline;
|
|
320
|
+
/**
|
|
321
|
+
* The scroll range a `view` timeline is mapped over, written the way CSS
|
|
322
|
+
* `animation-range` is: `entry 0% cover 45%` is the default, which plays the
|
|
323
|
+
* effect out over the first part of the element's journey up the screen.
|
|
324
|
+
*/
|
|
325
|
+
range?: string;
|
|
326
|
+
}
|
|
220
327
|
/** The options a `transition` prop takes when a bare effect name is not enough. */
|
|
221
328
|
export interface NebaTransitionOptions {
|
|
222
329
|
/** Which effect. */
|
|
@@ -239,6 +346,12 @@ export interface NebaTransitionOptions {
|
|
|
239
346
|
scale?: number;
|
|
240
347
|
/** How far a `rotate` turns from, in degrees. */
|
|
241
348
|
angle?: number;
|
|
349
|
+
/** Which edge a `reveal` is wiped from. @default 'left' */
|
|
350
|
+
side?: NebaSide;
|
|
351
|
+
/** What drives the progress. @default 'time' */
|
|
352
|
+
timeline?: NebaAnimateTimeline;
|
|
353
|
+
/** The scroll range a `view` timeline is mapped over, as CSS writes it. */
|
|
354
|
+
range?: string;
|
|
242
355
|
}
|
|
243
356
|
/**
|
|
244
357
|
* An entrance animation on a component that displays something.
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neba",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.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",
|
|
7
7
|
"sideEffects": [
|
|
8
8
|
"**/*.css"
|
|
9
9
|
],
|
|
10
|
-
"author": "CDGet
|
|
10
|
+
"author": "CDGet (https://cdget.com)",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"homepage": "https://neba.cdget.com",
|
|
13
13
|
"repository": {
|
|
@@ -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
|
},
|
|
@@ -138,21 +139,21 @@
|
|
|
138
139
|
"devDependencies": {
|
|
139
140
|
"@eslint/js": "^9.39.1",
|
|
140
141
|
"@tailwindcss/postcss": "^4.3.3",
|
|
141
|
-
"@types/node": "^26.4.
|
|
142
|
+
"@types/node": "^26.4.1",
|
|
142
143
|
"@types/react": "^19.2.18",
|
|
143
|
-
"@types/react-dom": "^19.2.
|
|
144
|
-
"@typescript-eslint/parser": "^8.
|
|
144
|
+
"@types/react-dom": "^19.2.7",
|
|
145
|
+
"@typescript-eslint/parser": "^8.69.0",
|
|
145
146
|
"@vitejs/plugin-react": "^6.1.1",
|
|
146
|
-
"@vitest/browser": "^
|
|
147
|
-
"@vitest/browser-playwright": "^
|
|
147
|
+
"@vitest/browser": "^5.0.0",
|
|
148
|
+
"@vitest/browser-playwright": "^5.0.0",
|
|
148
149
|
"eslint": "^9.39.1",
|
|
149
150
|
"eslint-config-prettier": "^10.1.8",
|
|
150
151
|
"eslint-plugin-n": "^18.3.0",
|
|
151
152
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
152
|
-
"globals": "^17.
|
|
153
|
+
"globals": "^17.12.0",
|
|
153
154
|
"jiti": "^2.7.0",
|
|
154
|
-
"playwright": "^1.
|
|
155
|
-
"postcss": "^8.5.
|
|
155
|
+
"playwright": "^1.63.0",
|
|
156
|
+
"postcss": "^8.5.28",
|
|
156
157
|
"prettier": "^3.9.6",
|
|
157
158
|
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
158
159
|
"react": "^19.2.8",
|
|
@@ -161,16 +162,16 @@
|
|
|
161
162
|
"terser-glob": "^1.2.1",
|
|
162
163
|
"tsx": "^4.23.13",
|
|
163
164
|
"typescript": "^6.0.3",
|
|
164
|
-
"typescript-eslint": "^8.
|
|
165
|
+
"typescript-eslint": "^8.69.0",
|
|
165
166
|
"vite": "^8.2.2",
|
|
166
167
|
"vitepress": "^1.6.4",
|
|
167
168
|
"vitepress-i18n": "^1.4.0",
|
|
168
|
-
"vitepress-sidebar": "^1.
|
|
169
|
-
"vitest": "^
|
|
170
|
-
"vitest-browser-react": "^2.
|
|
169
|
+
"vitepress-sidebar": "^1.40.0",
|
|
170
|
+
"vitest": "^5.0.0",
|
|
171
|
+
"vitest-browser-react": "^2.3.0"
|
|
171
172
|
},
|
|
172
173
|
"dependencies": {
|
|
173
|
-
"@base-ui/react": "^1.
|
|
174
|
+
"@base-ui/react": "^1.8.0",
|
|
174
175
|
"highlight.js": "^11.12.0"
|
|
175
176
|
},
|
|
176
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";import{useStyleDefaults as s}from"../../internal/defaults.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(o,m){const{max:c,total:v,overlap:p,size:f="md",shape:d="circle",variant:u="text",color:x="primary",elevation:h=0,className:g,style:j,children:y,...z}=s(o,["size","variant"]),A=a.useMemo(()=>({size:f,shape:d,variant:u,color:x,elevation:h}),[f,d,u,x,h]),M=a.Children.toArray(y),b=void 0===c?M:M.slice(0,Math.max(0,c)),N=v??M.length,$=Math.max(0,N-b.length);return r(i.Provider,{value:A,children:e("div",{ref:m,className:n("isolate inline-flex items-center","[&>*:not(:first-child)]:[margin-inline-start:calc(var(--n-overlap)*-1)]","[&>*]:ring-2 [&>*]:ring-(--neba-surface)",g??""),style:{"--n-overlap":void 0===p?l[f]:"number"==typeof p?`${p}px`:p,...j},...z,children:[b,$>0?r(t,{initials:`+${$}`}):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);
|