bianic-ui 2.15.0 → 2.15.1-alpha.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/cjs/index.js +86 -47
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/TimelineSlider/configs.d.ts +14 -2
- package/dist/cjs/types/stories/Form/Dropdown/DropdownContainer.stories.d.ts +1 -0
- package/dist/cjs/types/stories/Form/Dropdown/DropdownItem.test.stories.d.ts +35 -0
- package/dist/cjs/types/stories/Menu/Menu.test.stories.d.ts +12 -0
- package/dist/cjs/types/stories/Menu/NestedExample.stories.d.ts +1 -0
- package/dist/cjs/types/stories/TimelineSlider/TimelineSlider.stories.d.ts +4 -0
- package/dist/cjs/types/stories/TimelineSlider/TimelineSlider.test.stories.d.ts +8 -1
- package/dist/cjs/types/utility/hooks/useSubMenuSide.d.ts +4 -0
- package/dist/esm/index.js +87 -48
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/TimelineSlider/configs.d.ts +14 -2
- package/dist/esm/types/stories/Form/Dropdown/DropdownContainer.stories.d.ts +1 -0
- package/dist/esm/types/stories/Form/Dropdown/DropdownItem.test.stories.d.ts +35 -0
- package/dist/esm/types/stories/Menu/Menu.test.stories.d.ts +12 -0
- package/dist/esm/types/stories/Menu/NestedExample.stories.d.ts +1 -0
- package/dist/esm/types/stories/TimelineSlider/TimelineSlider.stories.d.ts +4 -0
- package/dist/esm/types/stories/TimelineSlider/TimelineSlider.test.stories.d.ts +8 -1
- package/dist/esm/types/utility/hooks/useSubMenuSide.d.ts +4 -0
- package/package.json +1 -1
|
@@ -20,7 +20,15 @@ export declare const MARKER_PX = 12;
|
|
|
20
20
|
* possible keeps the button focusable (aria-disabled) and looks disabled.
|
|
21
21
|
* On touch screens the tap area grows to 44px tall without changing the look.
|
|
22
22
|
*/
|
|
23
|
-
export declare const hintButtonClass = "aria-disabled:cursor-not-allowed aria-disabled:border-bia-coolgrey-disabled aria-disabled:text-bia-coolgrey-disabled aria-disabled:hover:border-bia-coolgrey-disabled aria-disabled:active:bg-primary-white [@media(pointer:coarse)]:relative [@media(pointer:coarse)]:after:absolute [@media(pointer:coarse)]:after:-inset-x-[2px] [@media(pointer:coarse)]:after:-inset-y-[7px] [@media(pointer:coarse)]:after:content-['']";
|
|
23
|
+
export declare const hintButtonClass = "disabled:cursor-not-allowed aria-disabled:cursor-not-allowed aria-disabled:border-bia-coolgrey-disabled aria-disabled:text-bia-coolgrey-disabled aria-disabled:hover:border-bia-coolgrey-disabled aria-disabled:active:bg-primary-white [@media(pointer:coarse)]:relative [@media(pointer:coarse)]:after:absolute [@media(pointer:coarse)]:after:-inset-x-[2px] [@media(pointer:coarse)]:after:-inset-y-[7px] [@media(pointer:coarse)]:after:content-['']";
|
|
24
|
+
/**
|
|
25
|
+
* Default-variant step buttons (bianic Button, default-outlined, sm).
|
|
26
|
+
* REVISI: a disabled button shows the not-allowed cursor; the bianic Button
|
|
27
|
+
* does not set one. Its disabled border class has a typo in buttonConfigs.ts
|
|
28
|
+
* (a missing space), so the light disabled border is set here too, matching
|
|
29
|
+
* the lite buttons.
|
|
30
|
+
*/
|
|
31
|
+
export declare const stepButtonClass = "disabled:cursor-not-allowed disabled:border-bia-coolgrey-disabled";
|
|
24
32
|
/** Icon color of a button that cannot move. The bianic Button colors icons black. */
|
|
25
33
|
export declare const inactiveIconClass = "!text-bia-coolgrey-disabled";
|
|
26
34
|
/**
|
|
@@ -50,7 +58,11 @@ export declare const LITE_BUTTON_LABELS: {
|
|
|
50
58
|
/** Hover delay before a tooltip shows. Keyboard focus shows it at once. */
|
|
51
59
|
export declare const HINT_DELAY_MS = 400;
|
|
52
60
|
export declare const hintBubbleClass = "pointer-events-none z-[150] w-max max-w-[240px] rounded-[4px] bg-bia-black px-[7px] py-[4px] font-segoe text-size-sm text-bia-white";
|
|
53
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Grey text, as in Figma ("Primary/Cool Grey" #8C8CA6). Its contrast on white
|
|
63
|
+
* is about 3.3:1; the team chose the Figma color (decision log BIAN-268).
|
|
64
|
+
*/
|
|
65
|
+
export declare const mutedTextClass = "text-bia-coolgrey";
|
|
54
66
|
/** Text for an empty period, in both variants. */
|
|
55
67
|
export declare const NO_EVENTS_TEXT = "No events in this period";
|
|
56
68
|
/** Default `noEventLabel`: a day without an event in a period that has events. */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { DropdownContainer } from '../../../components';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof DropdownContainer;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
a11y: {
|
|
10
|
+
test: string;
|
|
11
|
+
};
|
|
12
|
+
chromatic: {
|
|
13
|
+
disableSnapshot: boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
args: {
|
|
17
|
+
children: null;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
export declare const SubMenuOpensRightWhenItFits: Story;
|
|
23
|
+
export declare const SubMenuSmallOpensRightWhenItFits: Story;
|
|
24
|
+
export declare const SubMenuOpensLeftWhenOnlyLeftFits: Story;
|
|
25
|
+
export declare const SubMenuSmallOpensLeftWhenOnlyLeftFits: Story;
|
|
26
|
+
export declare const SubMenuFitsNeitherPicksRightWithMoreRoom: Story;
|
|
27
|
+
export declare const SubMenuFitsNeitherPicksLeftWithMoreRoom: Story;
|
|
28
|
+
export declare const SubMenuLevelThreeKeepsLeft: Story;
|
|
29
|
+
export declare const SubMenuSmallLevelThreeOpensRight: Story;
|
|
30
|
+
export declare const SubMenuMovesSideOnResize: Story;
|
|
31
|
+
export declare const SubMenuKeyboardOpensOnLeft: Story;
|
|
32
|
+
export declare const SubMenuKeyboardReopenKeepsSide: Story;
|
|
33
|
+
export declare const SubMenuArrowKeysOnLeft: Story;
|
|
34
|
+
export declare const SubMenuLeftSkipsDisabledChild: Story;
|
|
35
|
+
export declare const SubMenuRepro: Story;
|
|
@@ -26,3 +26,15 @@ export declare const EnterAndSpaceActivateItemsDisabledIsUnreachable: Story;
|
|
|
26
26
|
export declare const EscapeClosesMenuAndReturnsFocus: Story;
|
|
27
27
|
export declare const RightClickMenuKeyboard: Story;
|
|
28
28
|
export declare const SubMenuOpensWithArrowRightAndEscapeClosesOnlyIt: Story;
|
|
29
|
+
export declare const SubMenuMenuOpensRightWhenItFits: Story;
|
|
30
|
+
export declare const SubMenuMenuOpensLeftWhenOnlyLeftFits: Story;
|
|
31
|
+
export declare const SubMenuMenuFitsNeitherPicksRightWithMoreRoom: Story;
|
|
32
|
+
export declare const SubMenuMenuFitsNeitherPicksLeftWithMoreRoom: Story;
|
|
33
|
+
export declare const SubMenuMenuLevelThreeKeepsLeft: Story;
|
|
34
|
+
export declare const SubMenuMenuLevelThreeOpensRight: Story;
|
|
35
|
+
export declare const SubMenuMenuMovesSideOnResize: Story;
|
|
36
|
+
export declare const SubMenuMenuRepro: Story;
|
|
37
|
+
export declare const SubMenuMenuKeyboardOpensOnLeft: Story;
|
|
38
|
+
export declare const SubMenuMenuEnterAndSpaceOpenOnLeft: Story;
|
|
39
|
+
export declare const SubMenuMenuArrowKeysOnLeft: Story;
|
|
40
|
+
export declare const SubMenuMenuLeftSkipsDisabledChild: Story;
|
|
@@ -12,4 +12,5 @@ export default meta;
|
|
|
12
12
|
type Story = StoryObj<typeof meta>;
|
|
13
13
|
export declare const NestedExample: Story;
|
|
14
14
|
export declare const KeyboardNavigationSimulation: Story;
|
|
15
|
+
export declare const NestedNearRightEdgeSimulation: Story;
|
|
15
16
|
export declare const RightClickMenuSimulation: Story;
|
|
@@ -9,6 +9,10 @@ declare const meta: {
|
|
|
9
9
|
parameters: {
|
|
10
10
|
a11y: {
|
|
11
11
|
test: string;
|
|
12
|
+
context: {
|
|
13
|
+
include: string[];
|
|
14
|
+
exclude: string[];
|
|
15
|
+
};
|
|
12
16
|
};
|
|
13
17
|
chromatic: {
|
|
14
18
|
disableSnapshot: boolean;
|
|
@@ -345,5 +349,8 @@ export declare const DefaultButtonsMatchFigma: Story;
|
|
|
345
349
|
export declare const AxisLabelsAreTinyAndCentered: Story;
|
|
346
350
|
export declare const LiteInactiveIconIsGrey: Story;
|
|
347
351
|
export declare const LiteDateIsSmallSemiboldAndEventIsTiny: Story;
|
|
348
|
-
export declare const
|
|
352
|
+
export declare const LiteDayCountTextSizes: Story;
|
|
349
353
|
export declare const DefaultEventBadgeIs36pxTall: Story;
|
|
354
|
+
export declare const DisabledButtonsShowNotAllowedCursor: Story;
|
|
355
|
+
export declare const LiteDisabledButtonsShowNotAllowedCursor: Story;
|
|
356
|
+
export declare const GreyTextUsesFigmaCoolGrey: Story;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export declare const SubMenuSideContext: import("react").Context<boolean>;
|
|
3
|
+
export declare function pickIsLeft(itemRect: DOMRect, subMenuWidth: number, viewportWidth: number, preferLeft: boolean): boolean;
|
|
4
|
+
export default function useSubMenuSide(isOpen: boolean, itemRef: RefObject<HTMLElement>, subMenuRef: RefObject<HTMLElement>): boolean;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect, forwardRef, isValidElement, cloneElement, useRef, useLayoutEffect, useCallback, Children, useMemo, useId, useImperativeHandle, Fragment } from 'react';
|
|
1
|
+
import React, { useState, useEffect, forwardRef, isValidElement, cloneElement, useRef, useLayoutEffect, useCallback, Children, useMemo, createContext, useContext, useId, useImperativeHandle, Fragment } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
|
|
4
4
|
function Accordions(_a) {
|
|
@@ -2370,30 +2370,67 @@ function MenuContainerNoAnchorInner(propsComp, ref) {
|
|
|
2370
2370
|
}
|
|
2371
2371
|
var MenuContainerNoAnchor = forwardRef(MenuContainerNoAnchorInner);
|
|
2372
2372
|
|
|
2373
|
+
// Internal. Not exported from any index file.
|
|
2374
|
+
// Shared by DropdownItem and MenuItem to pick the side of a sub-menu.
|
|
2375
|
+
// true when the parent sub-menu opened on the left (deeper levels try left first)
|
|
2376
|
+
var SubMenuSideContext = createContext(false);
|
|
2377
|
+
function pickIsLeft(itemRect, subMenuWidth, viewportWidth, preferLeft) {
|
|
2378
|
+
var roomRight = viewportWidth - itemRect.right;
|
|
2379
|
+
var roomLeft = itemRect.left;
|
|
2380
|
+
var fitsRight = subMenuWidth <= roomRight;
|
|
2381
|
+
var fitsLeft = subMenuWidth <= roomLeft;
|
|
2382
|
+
if (preferLeft) {
|
|
2383
|
+
if (fitsLeft)
|
|
2384
|
+
return true;
|
|
2385
|
+
if (fitsRight)
|
|
2386
|
+
return false;
|
|
2387
|
+
return roomLeft >= roomRight;
|
|
2388
|
+
}
|
|
2389
|
+
if (fitsRight)
|
|
2390
|
+
return false;
|
|
2391
|
+
if (fitsLeft)
|
|
2392
|
+
return true;
|
|
2393
|
+
return roomLeft > roomRight;
|
|
2394
|
+
}
|
|
2395
|
+
function useSubMenuSide(isOpen, itemRef, subMenuRef) {
|
|
2396
|
+
var preferLeft = useContext(SubMenuSideContext);
|
|
2397
|
+
var _a = useState(false), isLeft = _a[0], setIsLeft = _a[1];
|
|
2398
|
+
var measure = useCallback(function () {
|
|
2399
|
+
var item = itemRef.current;
|
|
2400
|
+
var subMenu = subMenuRef.current;
|
|
2401
|
+
if (!item || !subMenu)
|
|
2402
|
+
return;
|
|
2403
|
+
setIsLeft(pickIsLeft(item.getBoundingClientRect(), subMenu.offsetWidth, document.documentElement.clientWidth, preferLeft));
|
|
2404
|
+
}, [preferLeft, itemRef, subMenuRef]);
|
|
2405
|
+
// No dependency array: runs before paint on every open and on every
|
|
2406
|
+
// re-render while open. Setting the same side again does nothing.
|
|
2407
|
+
useLayoutEffect(function () {
|
|
2408
|
+
if (!isOpen)
|
|
2409
|
+
return;
|
|
2410
|
+
measure();
|
|
2411
|
+
});
|
|
2412
|
+
useLayoutEffect(function () {
|
|
2413
|
+
if (!isOpen)
|
|
2414
|
+
return undefined;
|
|
2415
|
+
window.addEventListener('resize', measure);
|
|
2416
|
+
return function () { return window.removeEventListener('resize', measure); };
|
|
2417
|
+
}, [isOpen, measure]);
|
|
2418
|
+
return isLeft;
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2373
2421
|
function MenuItem(_a) {
|
|
2374
2422
|
var _b = _a.className, className = _b === void 0 ? '' : _b, label = _a.label, _c = _a.onClick, onClick = _c === void 0 ? function () { } : _c, _d = _a.caption, caption = _d === void 0 ? undefined : _d, _e = _a.isChecked, isChecked = _e === void 0 ? undefined : _e, _f = _a.onClose, onClose = _f === void 0 ? function () { } : _f, _g = _a.children, children = _g === void 0 ? undefined : _g, _h = _a.zIndex, zIndex = _h === void 0 ? 100 : _h, _j = _a.inheritedOnClick, inheritedOnClick = _j === void 0 ? function () { } : _j, _k = _a.disabled, disabled = _k === void 0 ? false : _k, _l = _a.onKeyDown, consumerOnKeyDown = _l === void 0 ? undefined : _l, _m = _a.onFocus, consumerOnFocus = _m === void 0 ? undefined : _m, _o = _a.onBlur, consumerOnBlur = _o === void 0 ? undefined : _o, props = __rest(_a, ["className", "label", "onClick", "caption", "isChecked", "onClose", "children", "zIndex", "inheritedOnClick", "disabled", "onKeyDown", "onFocus", "onBlur"]);
|
|
2375
2423
|
var _p = useState(false), isHovered = _p[0], setIsHovered = _p[1];
|
|
2376
2424
|
var _q = useState(false), isKeyboardOpen = _q[0], setIsKeyboardOpen = _q[1];
|
|
2377
2425
|
var _r = useState(false), isKeyFocused = _r[0], setIsKeyFocused = _r[1];
|
|
2378
2426
|
var outerRef = useRef(null);
|
|
2379
|
-
var _s = useState(false), isLeft = _s[0], setIsLeft = _s[1];
|
|
2380
2427
|
var isWithChecked = isChecked !== undefined;
|
|
2381
2428
|
var leftPadding = isWithChecked ? 'pl-[5px]' : 'pl-[10px]';
|
|
2382
2429
|
var rightPadding = caption || children ? 'pr-[5px]' : 'pr-[10px]';
|
|
2383
2430
|
var itemClass = "".concat(leftPadding, " ").concat(rightPadding, " ").concat(className);
|
|
2384
2431
|
var MenuContRef = useRef(null);
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
// Adjust dropdown position to prevent overflow on the right.
|
|
2388
|
-
var MenuContRect = MenuContRef.current.getBoundingClientRect();
|
|
2389
|
-
var RectRight = MenuContRect.right;
|
|
2390
|
-
var innerWindow = window.innerWidth;
|
|
2391
|
-
if (RectRight > innerWindow)
|
|
2392
|
-
setIsLeft(true);
|
|
2393
|
-
else
|
|
2394
|
-
setIsLeft(false);
|
|
2395
|
-
}
|
|
2396
|
-
}, [isHovered, isKeyboardOpen]);
|
|
2432
|
+
var isOpen = isHovered || isKeyboardOpen;
|
|
2433
|
+
var isLeft = useSubMenuSide(isOpen, outerRef, MenuContRef);
|
|
2397
2434
|
var translateClass = isLeft
|
|
2398
2435
|
? 'left-0 -translate-x-full'
|
|
2399
2436
|
: 'right-0 translate-x-full';
|
|
@@ -2470,10 +2507,11 @@ function MenuItem(_a) {
|
|
|
2470
2507
|
React.createElement("div", { className: "ml-auto flex items-center" },
|
|
2471
2508
|
children && (React.createElement(TbChevronRight, { className: "ml-[10px] text-bia-coolgrey" })),
|
|
2472
2509
|
children === undefined && caption && (React.createElement("span", { className: "ml-[30px] whitespace-nowrap text-[11px] ".concat(disabled ? 'text-bia-coolgrey-light-50' : 'text-bia-coolgrey') }, caption)))),
|
|
2473
|
-
children && !disabled && (React.createElement(
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2510
|
+
children && !disabled && (React.createElement(SubMenuSideContext.Provider, { value: isLeft },
|
|
2511
|
+
React.createElement(MenuContainerNoAnchor, { open: isOpen, onKeyDown: handleSubMenuKeyDown, onClose: function () {
|
|
2512
|
+
setIsKeyboardOpen(false);
|
|
2513
|
+
onClose();
|
|
2514
|
+
}, className: "absolute top-0 bg-primary-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] group-first/main:top-[6px] ".concat(translateClass), ref: MenuContRef, zIndex: currentZIndex + 10, onClickItem: function () { return inheritedOnClick(); } }, children)))));
|
|
2477
2515
|
}
|
|
2478
2516
|
|
|
2479
2517
|
var TooltipItem = function (_a) {
|
|
@@ -3196,26 +3234,14 @@ function DropdownItem(_a) {
|
|
|
3196
3234
|
var _o = useState(false), isHovered = _o[0], setIsHovered = _o[1];
|
|
3197
3235
|
var _p = useState(false), isKeyboardOpen = _p[0], setIsKeyboardOpen = _p[1];
|
|
3198
3236
|
var _q = useState(false), isKeyFocused = _q[0], setIsKeyFocused = _q[1];
|
|
3199
|
-
var _r = useState(false), isLeft = _r[0], setIsLeft = _r[1];
|
|
3200
3237
|
var outerRef = useRef(null);
|
|
3201
3238
|
var fontClass = fontConfig[size] || fontConfig.md;
|
|
3202
3239
|
var itemSizeClass = itemSizeConfig[size] || itemSizeConfig.md;
|
|
3203
3240
|
var itemClass = "".concat(itemSizeClass, " ").concat(fontClass, " ").concat(className);
|
|
3204
3241
|
var chevronSize = size === 'sm' ? 14 : 18;
|
|
3205
3242
|
var DropdownContRef = useRef(null);
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
if (DropdownContRef.current) {
|
|
3209
|
-
// Adjust dropdown position to prevent overflow on the right.
|
|
3210
|
-
var MenuContRect = (_a = DropdownContRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
3211
|
-
var RectRight = MenuContRect === null || MenuContRect === void 0 ? void 0 : MenuContRect.right;
|
|
3212
|
-
var innerWindow = window.innerWidth;
|
|
3213
|
-
if (RectRight > innerWindow)
|
|
3214
|
-
setIsLeft(true);
|
|
3215
|
-
else
|
|
3216
|
-
setIsLeft(false);
|
|
3217
|
-
}
|
|
3218
|
-
}, [isHovered, isKeyboardOpen]);
|
|
3243
|
+
var isOpen = isHovered || isKeyboardOpen;
|
|
3244
|
+
var isLeft = useSubMenuSide(isOpen, outerRef, DropdownContRef);
|
|
3219
3245
|
var translateClass = isLeft
|
|
3220
3246
|
? 'left-0 -translate-x-full'
|
|
3221
3247
|
: 'right-0 translate-x-full';
|
|
@@ -3276,10 +3302,11 @@ function DropdownItem(_a) {
|
|
|
3276
3302
|
React.createElement("button", __assign({ className: "relative flex w-full !min-w-fit items-center justify-start whitespace-nowrap bg-bia-white px-[15px] py-[5px] text-left text-bia-black disabled:cursor-not-allowed disabled:text-bia-coolgrey-light-50 hover:[&:not(:disabled)]:bg-bia-blue-pastel ".concat(itemClass).concat(keyFocusClass), style: { zIndex: currentZIndex + 15 }, onClick: function (e) { return onClickItem(e, value); }, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: handleBlur, disabled: disabled, type: "button" }, props),
|
|
3277
3303
|
content,
|
|
3278
3304
|
React.createElement("div", { className: "ml-auto flex items-center" }, children && (React.createElement(TbChevronRight, { className: "ml-[10px] text-bia-coolgrey", size: chevronSize })))),
|
|
3279
|
-
children && (React.createElement(
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3305
|
+
children && (React.createElement(SubMenuSideContext.Provider, { value: isLeft },
|
|
3306
|
+
React.createElement(DropdownContNoAnchor, { className: "absolute top-0 bg-primary-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] group-first/main:top-[6px] ".concat(translateClass), onClose: function () {
|
|
3307
|
+
setIsKeyboardOpen(false);
|
|
3308
|
+
onClose();
|
|
3309
|
+
}, onKeyDown: handleSubMenuKeyDown, open: isOpen, onClickItem: function (e, itemValue) { return onClickItem(e, itemValue); }, size: size, ref: DropdownContRef, zIndex: currentZIndex + 10 }, children)))));
|
|
3283
3310
|
}
|
|
3284
3311
|
|
|
3285
3312
|
var matchSearchTerm = function (content, term, variant) {
|
|
@@ -7541,7 +7568,15 @@ var MARKER_PX = 12;
|
|
|
7541
7568
|
* possible keeps the button focusable (aria-disabled) and looks disabled.
|
|
7542
7569
|
* On touch screens the tap area grows to 44px tall without changing the look.
|
|
7543
7570
|
*/
|
|
7544
|
-
var hintButtonClass = "aria-disabled:cursor-not-allowed aria-disabled:border-bia-coolgrey-disabled aria-disabled:text-bia-coolgrey-disabled aria-disabled:hover:border-bia-coolgrey-disabled aria-disabled:active:bg-primary-white [@media(pointer:coarse)]:relative [@media(pointer:coarse)]:after:absolute [@media(pointer:coarse)]:after:-inset-x-[2px] [@media(pointer:coarse)]:after:-inset-y-[7px] [@media(pointer:coarse)]:after:content-['']";
|
|
7571
|
+
var hintButtonClass = "disabled:cursor-not-allowed aria-disabled:cursor-not-allowed aria-disabled:border-bia-coolgrey-disabled aria-disabled:text-bia-coolgrey-disabled aria-disabled:hover:border-bia-coolgrey-disabled aria-disabled:active:bg-primary-white [@media(pointer:coarse)]:relative [@media(pointer:coarse)]:after:absolute [@media(pointer:coarse)]:after:-inset-x-[2px] [@media(pointer:coarse)]:after:-inset-y-[7px] [@media(pointer:coarse)]:after:content-['']";
|
|
7572
|
+
/**
|
|
7573
|
+
* Default-variant step buttons (bianic Button, default-outlined, sm).
|
|
7574
|
+
* REVISI: a disabled button shows the not-allowed cursor; the bianic Button
|
|
7575
|
+
* does not set one. Its disabled border class has a typo in buttonConfigs.ts
|
|
7576
|
+
* (a missing space), so the light disabled border is set here too, matching
|
|
7577
|
+
* the lite buttons.
|
|
7578
|
+
*/
|
|
7579
|
+
var stepButtonClass = 'disabled:cursor-not-allowed disabled:border-bia-coolgrey-disabled';
|
|
7545
7580
|
/** Icon color of a button that cannot move. The bianic Button colors icons black. */
|
|
7546
7581
|
var inactiveIconClass = '!text-bia-coolgrey-disabled';
|
|
7547
7582
|
/**
|
|
@@ -7571,7 +7606,11 @@ var LITE_BUTTON_LABELS = {
|
|
|
7571
7606
|
/** Hover delay before a tooltip shows. Keyboard focus shows it at once. */
|
|
7572
7607
|
var HINT_DELAY_MS = 400;
|
|
7573
7608
|
var hintBubbleClass = 'pointer-events-none z-[150] w-max max-w-[240px] rounded-[4px] bg-bia-black px-[7px] py-[4px] font-segoe text-size-sm text-bia-white';
|
|
7574
|
-
|
|
7609
|
+
/**
|
|
7610
|
+
* Grey text, as in Figma ("Primary/Cool Grey" #8C8CA6). Its contrast on white
|
|
7611
|
+
* is about 3.3:1; the team chose the Figma color (decision log BIAN-268).
|
|
7612
|
+
*/
|
|
7613
|
+
var mutedTextClass = 'text-bia-coolgrey';
|
|
7575
7614
|
/** Text for an empty period, in both variants. */
|
|
7576
7615
|
var NO_EVENTS_TEXT = 'No events in this period';
|
|
7577
7616
|
/** Default `noEventLabel`: a day without an event in a period that has events. */
|
|
@@ -8109,11 +8148,11 @@ function DefaultLayout(_a) {
|
|
|
8109
8148
|
React.createElement(Text, { variant: "tiny-text", className: "".concat(mutedTextClass, " ").concat(axisLabelClass) }, tick.label))); })),
|
|
8110
8149
|
React.createElement("div", { className: "mt-[14px] flex items-center justify-between gap-[5px]" },
|
|
8111
8150
|
React.createElement("div", { className: "flex gap-[5px]" },
|
|
8112
|
-
React.createElement(Button, { variant: "default-outlined", size: "sm", label: "Previous Event", iconLeft: React.createElement(TbChevronLeftPipe, { "aria-hidden": "true", className: iconClass(noPreviousEvent) }), disabled: noPreviousEvent, onClick: function () { return previousEvent && goToDay(previousEvent.day); } }),
|
|
8113
|
-
React.createElement(Button, { variant: "default-outlined", size: "sm", label: "Day", "aria-label": "Previous day", iconLeft: React.createElement(TbChevronLeft, { "aria-hidden": "true", className: iconClass(noPreviousDay) }), disabled: noPreviousDay, onClick: function () { return goToDay(valueDay - 1); } })),
|
|
8151
|
+
React.createElement(Button, { variant: "default-outlined", size: "sm", className: stepButtonClass, label: "Previous Event", iconLeft: React.createElement(TbChevronLeftPipe, { "aria-hidden": "true", className: iconClass(noPreviousEvent) }), disabled: noPreviousEvent, onClick: function () { return previousEvent && goToDay(previousEvent.day); } }),
|
|
8152
|
+
React.createElement(Button, { variant: "default-outlined", size: "sm", className: stepButtonClass, label: "Day", "aria-label": "Previous day", iconLeft: React.createElement(TbChevronLeft, { "aria-hidden": "true", className: iconClass(noPreviousDay) }), disabled: noPreviousDay, onClick: function () { return goToDay(valueDay - 1); } })),
|
|
8114
8153
|
React.createElement("div", { className: "flex gap-[5px]" },
|
|
8115
|
-
React.createElement(Button, { variant: "default-outlined", size: "sm", label: "Day", "aria-label": "Next day", iconRight: React.createElement(TbChevronRight, { "aria-hidden": "true", className: iconClass(noNextDay) }), disabled: noNextDay, onClick: function () { return goToDay(valueDay + 1); } }),
|
|
8116
|
-
React.createElement(Button, { variant: "default-outlined", size: "sm", label: "Next Event", iconRight: React.createElement(TbChevronRightPipe, { "aria-hidden": "true", className: iconClass(noNextEvent) }), disabled: noNextEvent, onClick: function () { return nextEvent && goToDay(nextEvent.day); } })))));
|
|
8154
|
+
React.createElement(Button, { variant: "default-outlined", size: "sm", className: stepButtonClass, label: "Day", "aria-label": "Next day", iconRight: React.createElement(TbChevronRight, { "aria-hidden": "true", className: iconClass(noNextDay) }), disabled: noNextDay, onClick: function () { return goToDay(valueDay + 1); } }),
|
|
8155
|
+
React.createElement(Button, { variant: "default-outlined", size: "sm", className: stepButtonClass, label: "Next Event", iconRight: React.createElement(TbChevronRightPipe, { "aria-hidden": "true", className: iconClass(noNextEvent) }), disabled: noNextEvent, onClick: function () { return nextEvent && goToDay(nextEvent.day); } })))));
|
|
8117
8156
|
}
|
|
8118
8157
|
|
|
8119
8158
|
var NO_EVENTS = [];
|
|
@@ -8156,18 +8195,18 @@ function LiteLayout(_a) {
|
|
|
8156
8195
|
!currentEvent && statusText && (React.createElement(TruncatedText, { text: statusText, textSize: "tiny", textClassName: mutedTextClass })))),
|
|
8157
8196
|
React.createElement(Track, { className: "mx-5 min-w-[80px] flex-1", timeline: timeline, sliderLabel: sliderLabel, disabled: disabled }),
|
|
8158
8197
|
React.createElement("div", { className: "mr-5 flex shrink-0 flex-col items-end gap-[2px]" },
|
|
8159
|
-
React.createElement(Text, { variant: "tiny-text", className: mutedTextClass }, "Day"),
|
|
8160
|
-
React.createElement("span", { className: "grid grid-rows-[14px] whitespace-nowrap font-
|
|
8198
|
+
React.createElement(Text, { variant: "tiny-text", className: "".concat(mutedTextClass, " leading-4") }, "Day"),
|
|
8199
|
+
React.createElement("span", { className: "grid grid-rows-[14px] whitespace-nowrap font-segoe text-size-sm tabular-nums" },
|
|
8161
8200
|
React.createElement("span", { "aria-hidden": "true", className: "invisible col-start-1 row-start-1" },
|
|
8162
|
-
React.createElement(Text, { variant: "
|
|
8201
|
+
React.createElement(Text, { variant: "small-text-semibold" }, totalDays),
|
|
8163
8202
|
' ',
|
|
8164
|
-
React.createElement(Text, { variant: "
|
|
8203
|
+
React.createElement(Text, { variant: "small-text-semibold" },
|
|
8165
8204
|
"/ ",
|
|
8166
8205
|
totalDays)),
|
|
8167
8206
|
React.createElement("span", { className: "col-start-1 row-start-1 text-right" },
|
|
8168
|
-
React.createElement(Text, { variant: "
|
|
8207
|
+
React.createElement(Text, { variant: "small-text-semibold" }, dayOfPeriod),
|
|
8169
8208
|
' ',
|
|
8170
|
-
React.createElement(Text, { variant: "
|
|
8209
|
+
React.createElement(Text, { variant: "small-text-semibold", className: mutedTextClass },
|
|
8171
8210
|
"/ ",
|
|
8172
8211
|
totalDays)))),
|
|
8173
8212
|
React.createElement("div", { className: "flex shrink-0 gap-[5px]" },
|