asma-ui-core 3.98.2 → 3.100.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/dist/asma-ui-core.css +1 -1
- package/dist/components/data-display/badge/StyledBadge.js +33 -31
- package/dist/datetime/components/time-picker/StyledTimePicker.js +63 -56
- package/dist/datetime/components/time-picker/StyledTimePicker.module.js +6 -6
- package/dist/datetime/components/time-picker/TimePickerInput.js +24 -23
- package/dist/datetime/components/time-picker/TimePickerPopper.js +20 -19
- package/dist/datetime/components/time-picker/components/TimePickerBody.js +19 -17
- package/dist/datetime/components/time-picker/components/TimePickerColumn.js +16 -13
- package/dist/datetime/components/time-picker/components/TimePickerPanel.js +12 -11
- package/dist/datetime/components/time-picker/helpers/getTimeFromValue.js +5 -5
- package/dist/datetime/components/time-picker/helpers/minTime.js +12 -0
- package/dist/src/components/data-display/badge/StyledBadge.d.ts +20 -2
- package/dist/src/datetime/components/time-picker/TimePickerInput.d.ts +1 -0
- package/dist/src/datetime/components/time-picker/components/TimePickerPanel.d.ts +1 -0
- package/dist/src/datetime/components/time-picker/helpers/minTime.d.ts +12 -0
- package/dist/src/datetime/components/time-picker/helpers/minTime.test.d.ts +1 -0
- package/dist/src/datetime/components/time-picker/types.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { CSSProperties, ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
type StyledBadgeSize = 'medium' | 'small';
|
|
3
|
+
/** Figma's `Parent` axis. It sets the dot's size and fill together, which is why it is not a colour. */
|
|
4
|
+
type StyledBadgePurpose = 'notification' | 'unread' | 'filter';
|
|
3
5
|
/**
|
|
4
6
|
* @figmaNode wXrXt5uKNNzV2DnQCgyYZH#15181-43817
|
|
5
7
|
* Figma "Badge". Notification count = 20px lime pill with a 1px border and Helper-Semibold 14/20;
|
|
6
8
|
* `dot` = 12px lime circle with a stronger 2px border. Other colors and `small` are legacy app
|
|
7
9
|
* extensions with no matching Figma notification variant.
|
|
10
|
+
*
|
|
11
|
+
* Pass children to decorate them — the badge anchors to their corner. Pass none and a `dot` becomes
|
|
12
|
+
* a flow element (Figma `Size=Dot`, node 44267-214524), for a table cell or a marker in a row, and
|
|
13
|
+
* `className` then applies to the badge's own root so the caller can place it.
|
|
14
|
+
*
|
|
15
|
+
* `purpose` selects Figma's `Parent`: the default notification dot, or the 8px solid primary dot
|
|
16
|
+
* that marks something unread or a filter as active.
|
|
8
17
|
*/
|
|
9
18
|
interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {
|
|
10
19
|
/** @figmaProp Badge content (the number/label) */
|
|
@@ -15,8 +24,17 @@ interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {
|
|
|
15
24
|
max?: number;
|
|
16
25
|
/** @deprecated A zero notification count is always omitted. */
|
|
17
26
|
showZero?: boolean;
|
|
18
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @figmaProp Size = dot→"Dot" (12px) | standard→"Default" count badge
|
|
29
|
+
* A `dot` with no children renders in normal flow rather than anchored to a corner.
|
|
30
|
+
*/
|
|
19
31
|
variant?: 'standard' | 'dot';
|
|
32
|
+
/**
|
|
33
|
+
* @figmaProp Parent = notification→the lime ringed dot | unread/filter→an 8px solid primary dot
|
|
34
|
+
* `unread` and `filter` are the same mark in Figma and differ only in meaning. Dots only: a
|
|
35
|
+
* count badge is always the notification pill.
|
|
36
|
+
*/
|
|
37
|
+
purpose?: StyledBadgePurpose;
|
|
20
38
|
/** Polite live-update text. Keep this contextual and include the real, uncapped count. */
|
|
21
39
|
statusMessage?: string;
|
|
22
40
|
invisible?: boolean;
|
|
@@ -46,5 +64,5 @@ type StyledBadgeProps = BadgeProps & {
|
|
|
46
64
|
* The established styling API `sx={{ '& .MuiBadge-badge': {...} }}` is preserved by extracting that
|
|
47
65
|
* slot and applying `resolveSx` to the badge span (DEC-007 slot-sx). Signature unchanged (DEC-003).
|
|
48
66
|
*/
|
|
49
|
-
export declare const StyledBadge: ({ color, dataTest, size, badgeContent, max: _max, showZero: _showZero, variant, statusMessage, invisible, anchorOrigin, children, className, sx, overlap: _overlap, classes: _classes, slots: _slots, slotProps, component: _component, tabIndex: _tabIndex, ...props }: StyledBadgeProps) => JSX.Element;
|
|
67
|
+
export declare const StyledBadge: ({ color, dataTest, size, badgeContent, max: _max, showZero: _showZero, variant, purpose, statusMessage, invisible, anchorOrigin, children, className, sx, overlap: _overlap, classes: _classes, slots: _slots, slotProps, component: _component, tabIndex: _tabIndex, ...props }: StyledBadgeProps) => JSX.Element;
|
|
50
68
|
export {};
|
|
@@ -4,6 +4,7 @@ import { ChangeEvent } from 'react';
|
|
|
4
4
|
export declare const TimePickerInput: React.FC<StyledTimePickerProps & {
|
|
5
5
|
popupState: PopupState;
|
|
6
6
|
handleChange: (e: ChangeEvent<HTMLTextAreaElement | HTMLInputElement>) => void;
|
|
7
|
+
handleBlur?: () => void;
|
|
7
8
|
isValidTime: boolean;
|
|
8
9
|
isValidEndTime: boolean;
|
|
9
10
|
localValue: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The minutes column offers 00, 05 … 55. */
|
|
2
|
+
export declare const MINUTE_STEP = 5;
|
|
3
|
+
/** Only the clock time of both dates counts; the calendar day is the consumer's concern. */
|
|
4
|
+
export declare const isBeforeMinTime: (time: Date, minTime?: Date) => boolean;
|
|
5
|
+
/** An hour is disabled when none of its minute cells reaches `minTime` (e.g. hour 12 for 12:57). */
|
|
6
|
+
export declare const isHourDisabled: (hour: number, minTime?: Date) => boolean;
|
|
7
|
+
export declare const isMinuteDisabled: (hour: number, minute: number, minTime?: Date) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Picking the `minTime` hour while the kept minutes fall before it (13:10 → hour 12 with minTime 12:35)
|
|
10
|
+
* would land on a disabled cell, so the minutes move up to the first enabled cell (12:35).
|
|
11
|
+
*/
|
|
12
|
+
export declare const clampToMinTime: (time: Date, minTime?: Date) => Date;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -17,5 +17,12 @@ export interface StyledTimePickerProps {
|
|
|
17
17
|
locale?: 'no' | 'en';
|
|
18
18
|
title?: string;
|
|
19
19
|
notBeforeTime?: Date;
|
|
20
|
+
/**
|
|
21
|
+
* @figmaProp none — behavioral; drives the Time item `State=Disabled` cells (node 15086-19871).
|
|
22
|
+
* Earliest selectable clock time; its calendar day is ignored. Earlier hour/minute cells are disabled
|
|
23
|
+
* and a typed earlier time is not committed — the field reverts to the last valid value on blur.
|
|
24
|
+
* Unlike `notBeforeTime`, it never shows an error.
|
|
25
|
+
*/
|
|
26
|
+
minTime?: Date;
|
|
20
27
|
}
|
|
21
28
|
export type IPopupStateType = JSX.Element;
|