@veevarts/design-system 2.1.0-beta.23 → 2.1.0-beta.25
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 +7 -1
- package/dist/components/DatePicker/DatePicker.d.ts +9 -2
- package/dist/components/DatePicker/defaults.d.ts +28 -0
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +37 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +5761 -5309
- package/dist/patterns/AdminTable/styles.d.ts +2 -1
- package/dist/patterns/EntityRow/EntityList.d.ts +6 -0
- package/dist/patterns/ExpandableTable/ExpandableTable.d.ts +6 -0
- package/dist/patterns/ExpandableTable/index.d.ts +2 -0
- package/dist/patterns/ExpandableTable/styles.d.ts +43 -0
- package/dist/patterns/ExpandableTable/types.d.ts +99 -0
- package/dist/patterns/NeedsFixDot/NeedsFixDot.d.ts +16 -0
- package/dist/patterns/NeedsFixDot/firstNeedsFixKey.d.ts +18 -0
- package/dist/patterns/NeedsFixDot/index.d.ts +4 -0
- package/dist/patterns/NeedsFixDot/styles.d.ts +20 -0
- package/dist/patterns/TimeField/TimeField.d.ts +6 -0
- package/dist/patterns/TimeField/index.d.ts +3 -0
- package/dist/patterns/TimeField/time.d.ts +40 -0
- package/dist/patterns/TimeField/types.d.ts +77 -0
- package/dist/patterns/UnderlineTabs/UnderlineTabs.d.ts +13 -1
- package/dist/patterns/UnderlineTabs/styles.d.ts +5 -0
- package/dist/patterns/index.d.ts +6 -0
- package/dist/providers/ToastProvider.d.ts +9 -4
- package/dist/test/reducedMotionCss.d.ts +40 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -211,7 +211,13 @@ For `mode="datetime"`, the design system does not convert timezones. The consumi
|
|
|
211
211
|
</HeroUIProvider>
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
**Readable toasts (`ToastProvider`).** The `ToastProvider` exported here wraps HeroUI's: same props, same `addToast` queue. Titles wrap instead of truncating to one line, and the animation is off when the OS or the POS (`data-pos-reduce-motion`) asks for reduced motion, unless you pass `disableAnimation`.
|
|
214
|
+
**Readable toasts (`ToastProvider`).** The `ToastProvider` exported here wraps HeroUI's: same props, same `addToast` queue. Titles wrap instead of truncating to one line, and the animation is off when the OS or the POS (`data-pos-reduce-motion`) asks for reduced motion, unless you pass `disableAnimation`.
|
|
215
|
+
|
|
216
|
+
From `sm` up a toast takes the width its text needs, between HeroUI's 356px and `min(32rem, 100vw - 11rem)`, instead of a fixed 356px: both bounds are `rem`, so it keeps up when the root font grows (the POS Text size setting, or a larger browser default). The close button sits inside the toast beside the title, always visible, as a 44px (`2.75rem`) target, instead of HeroUI's hover-only circle on the corner. A short toast at the default text size is the same 356px as before.
|
|
217
|
+
|
|
218
|
+
A `toastProps.classNames` you pass is merged after these defaults, slot by slot (`base`, `closeButton`, `closeIcon`, `title`, `description`). HeroUI replaces the provider `classNames` with a per-toast `addToast({ classNames })` as a whole object, so a per-toast `classNames` drops these defaults for that toast.
|
|
219
|
+
|
|
220
|
+
**Still skeletons (`Skeleton`).** The `Skeleton` exported here wraps HeroUI's: same props. HeroUI draws the shimmer on the block's `::before`, so `motion-reduce:animate-none` on the block never stops it. This one adds `motion-reduce:before:animate-none` (and the transition equivalents), so under the OS "reduce motion" setting the block is a plain grey shape at the same size; with motion allowed nothing changes. `EntityListSkeleton` and the other DS skeletons draw their blocks with it.
|
|
215
221
|
|
|
216
222
|
```tsx
|
|
217
223
|
<HeroUIProvider>
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { ButtonProps, DatePickerProps as HeroUIDatePickerProps, TimeInputProps as HeroUITimeInputProps } from '@heroui/react';
|
|
2
|
-
type
|
|
2
|
+
type CalendarMarkProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Rings today's cell in the calendar. HeroUI only flags it. Off by
|
|
5
|
+
* default; `DATE_PICKER_DAY_DEFAULTS` turns it on.
|
|
6
|
+
*/
|
|
7
|
+
markToday?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type DateOnlyProps = HeroUIDatePickerProps & CalendarMarkProps & {
|
|
3
10
|
mode?: 'date';
|
|
4
11
|
};
|
|
5
|
-
type DateTimeProps = HeroUIDatePickerProps & {
|
|
12
|
+
type DateTimeProps = HeroUIDatePickerProps & CalendarMarkProps & {
|
|
6
13
|
mode: 'datetime';
|
|
7
14
|
};
|
|
8
15
|
type TimeOnlyProps = HeroUITimeInputProps & {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The calendar for picking one day the way the program page does, in one
|
|
3
|
+
* spread: weeks start on Monday, the month and the year can be jumped to (a
|
|
4
|
+
* program can be set up a year ahead), and today is marked with a ring so
|
|
5
|
+
* people know where they are. Nothing is preselected: leave `value` empty and
|
|
6
|
+
* the field stays empty.
|
|
7
|
+
*
|
|
8
|
+
* Opt-in. A `DatePicker` without it keeps HeroUI's behaviour (the locale's
|
|
9
|
+
* first weekday, month-by-month paging, today unmarked).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <DatePicker {...DATE_PICKER_DAY_DEFAULTS} label={t('startDate')} value={start} onChange={setStart} />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const DATE_PICKER_DAY_DEFAULTS: {
|
|
17
|
+
readonly firstDayOfWeek: "mon";
|
|
18
|
+
readonly showMonthAndYearPickers: true;
|
|
19
|
+
readonly markToday: true;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* What `markToday` adds to every calendar cell. HeroUI only flags today
|
|
23
|
+
* (`data-today`) and draws nothing for it. The ring is the primary color, so
|
|
24
|
+
* once today is selected it disappears into the primary fill, which the
|
|
25
|
+
* `DayDefaults` story measures. (A `data-[selected=true]:ring-0` would not
|
|
26
|
+
* help: it loses to the ring in the generated CSS.)
|
|
27
|
+
*/
|
|
28
|
+
export declare const TODAY_RING_CLASS = "data-[today=true]:font-semibold data-[today=true]:ring-1 data-[today=true]:ring-inset data-[today=true]:ring-primary";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SkeletonProps as HeroUISkeletonProps } from '@heroui/react';
|
|
2
|
+
export type SkeletonProps = HeroUISkeletonProps;
|
|
3
|
+
/**
|
|
4
|
+
* What HeroUI's own `disableAnimation` adds to the skeleton, applied only while
|
|
5
|
+
* the OS asks for reduced motion (`prefers-reduced-motion: reduce`).
|
|
6
|
+
*
|
|
7
|
+
* HeroUI draws the shimmer on the block's `::before` (`before:animate-shimmer`),
|
|
8
|
+
* so `motion-reduce:animate-none` on the block never reaches it: the sweep kept
|
|
9
|
+
* running for anyone who had turned motion off. Each pseudo-element and
|
|
10
|
+
* property needs its own utility:
|
|
11
|
+
*
|
|
12
|
+
* - `before:animate-none` stops the shimmer. The `::before` stays parked at
|
|
13
|
+
* `-translate-x-full`, outside the block, so what is left is the plain grey
|
|
14
|
+
* block, at the same size and in the same place.
|
|
15
|
+
* - `animate-none` stops an animation on the block itself (a caller's
|
|
16
|
+
* `animate-pulse`, for one).
|
|
17
|
+
* - `transition-none`, `before:transition-none` and `after:transition-none`
|
|
18
|
+
* drop the fade HeroUI runs when `isLoaded` flips.
|
|
19
|
+
*
|
|
20
|
+
* Every utility sits behind `motion-reduce:`, so with motion allowed the class
|
|
21
|
+
* list resolves exactly as before and the shimmer is unchanged. Tailwind emits
|
|
22
|
+
* the `motion-reduce` rules after the plain `before:` ones, so they win at
|
|
23
|
+
* equal specificity.
|
|
24
|
+
*/
|
|
25
|
+
export declare const SKELETON_REDUCED_MOTION_CLASS = "motion-reduce:animate-none motion-reduce:transition-none motion-reduce:before:animate-none motion-reduce:before:transition-none motion-reduce:after:transition-none";
|
|
26
|
+
/**
|
|
27
|
+
* HeroUI `Skeleton` that holds still under reduced motion. Every HeroUI prop is
|
|
28
|
+
* kept, and an explicit `disableAnimation` still turns the shimmer off for
|
|
29
|
+
* everyone.
|
|
30
|
+
*
|
|
31
|
+
* The defaults go first in `classNames.base`, ahead of the caller's
|
|
32
|
+
* `classNames.base` and `className`, so a caller can still override any of
|
|
33
|
+
* them. Every DS skeleton (`EntityListSkeleton`, `OfferCardSkeleton`,
|
|
34
|
+
* `RevenueDistributionSkeleton`, `InstallmentScheduleSkeleton`,
|
|
35
|
+
* `InstallmentFundAssignmentSkeleton`) draws its blocks with this component.
|
|
36
|
+
*/
|
|
37
|
+
export declare const Skeleton: import('react').ForwardRefExoticComponent<Omit<HeroUISkeletonProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -15,7 +15,7 @@ export { AppliedCodeCard } from './AppliedCodeCard';
|
|
|
15
15
|
export type { AppliedCodeCardProps } from './AppliedCodeCard';
|
|
16
16
|
export { Button } from './Button';
|
|
17
17
|
export type { ButtonProps } from './Button';
|
|
18
|
-
export { DatePicker } from './DatePicker';
|
|
18
|
+
export { DatePicker, DATE_PICKER_DAY_DEFAULTS } from './DatePicker';
|
|
19
19
|
export type { DatePickerProps } from './DatePicker';
|
|
20
20
|
export { Drawer } from './Drawer';
|
|
21
21
|
export type { DrawerProps } from './Drawer';
|
|
@@ -23,6 +23,8 @@ export { Modal } from './Modal';
|
|
|
23
23
|
export type { ModalProps } from './Modal';
|
|
24
24
|
export { Select } from './Select';
|
|
25
25
|
export type { SelectProps } from './Select';
|
|
26
|
+
export { Skeleton } from './Skeleton';
|
|
27
|
+
export type { SkeletonProps } from './Skeleton';
|
|
26
28
|
export { Table } from './Table';
|
|
27
29
|
export type { TableProps } from './Table';
|
|
28
30
|
export { RedeemCodeInput } from './RedeemCodeInput';
|