@bcrumbs.net/bc-ui 0.0.13 → 0.0.15
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/index.esm.js +582 -31667
- package/package.json +5 -2
- package/src/index.d.ts +3 -0
- package/src/lib/baseComponents/button.d.ts +1 -1
- package/src/lib/charts/formatChartAxisTick.d.ts +21 -0
- package/src/lib/coloredTag/ColoredTag.d.ts +15 -0
- package/src/lib/coloredTag/getDynamicTagColors.d.ts +13 -0
- package/src/lib/hooks/useForm/index.d.ts +1 -1
- package/src/lib/icon/bcicon.d.ts +20 -0
- package/src/lib/multiSelector/MutliSelector.d.ts +0 -5
- package/src/lib/navigation/types.d.ts +1 -0
- package/src/lib/newComponents/BCNewAlertDialog/BCNewAlertDialog.d.ts +27 -2
- package/src/lib/newComponents/BCNewAlertDialog/types.d.ts +1 -27
- package/src/lib/newComponents/BCNewDropdown/types.d.ts +1 -0
- package/src/lib/newComponents/BCNewTooltip/types.d.ts +1 -0
- package/src/lib/textbox/bctextbox.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcrumbs.net/bc-ui",
|
|
3
3
|
"description": "The UI components of Bread Crumbs portals",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.15",
|
|
5
5
|
"keyword": [
|
|
6
6
|
"bcrumbs",
|
|
7
7
|
"bc-ui"
|
|
8
8
|
],
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"react": "18.
|
|
10
|
+
"react": "^18.0.0",
|
|
11
|
+
"react-dom": "^18.0.0",
|
|
12
|
+
"i18next": "^21.0.0",
|
|
13
|
+
"react-i18next": "^11.0.0",
|
|
11
14
|
"@emotion/react": "11.5.0",
|
|
12
15
|
"@emotion/styled": "11.3.0",
|
|
13
16
|
"@radix-ui/themes": "^3.1.5",
|
package/src/index.d.ts
CHANGED
|
@@ -41,11 +41,14 @@ export * from './lib/dateRangePicker';
|
|
|
41
41
|
export * from './lib/InputWithSuggestions';
|
|
42
42
|
export * from './lib/textArea';
|
|
43
43
|
export * from './lib/tagDisplay/TagDisplay';
|
|
44
|
+
export * from './lib/coloredTag/getDynamicTagColors';
|
|
45
|
+
export * from './lib/coloredTag/ColoredTag';
|
|
44
46
|
export * from './lib/styledFormInput/StyledFormInput';
|
|
45
47
|
export * from './lib/newComponents/BCNewTable/BCNewTable';
|
|
46
48
|
export * from './lib/newComponents/BCNewDropdown/BCNewDropdown';
|
|
47
49
|
export * from './lib/newComponents/BCNewTooltip/BCNewTooltip';
|
|
48
50
|
export * from './lib/newComponents/BCNewAlertDialog/BCNewAlertDialog';
|
|
51
|
+
export type { RAlertDialogProps } from './lib/newComponents/BCNewAlertDialog/BCNewAlertDialog';
|
|
49
52
|
export * from './lib/newComponents/BCNewDialog/BCNewDialog';
|
|
50
53
|
export * from './lib/newComponents/BCRadioGroupItem/BCRadioItem';
|
|
51
54
|
export * from './lib/newComponents/BCNewTabs/BCNewTabs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface ButtonStyleProps {
|
|
3
|
-
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
3
|
+
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link' | 'warning';
|
|
4
4
|
size?: 'default' | 'sm' | 'lg' | 'icon';
|
|
5
5
|
}
|
|
6
6
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ButtonStyleProps {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats Y-axis tick values with a leading zero for decimals (e.g. 0.75, not .75).
|
|
3
|
+
* Uses Western numerals for consistent chart readability across locales.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatChartAxisTick(value: number): string;
|
|
6
|
+
export declare const CHART_Y_AXIS_WIDTH = 44;
|
|
7
|
+
/** Gap between Y-axis line and tick labels (larger in RTL where axis is on the right). */
|
|
8
|
+
export declare function getChartYAxisTickMargin(rtl: boolean): number;
|
|
9
|
+
/**
|
|
10
|
+
* Positions labels inside the plot area, away from the axis line.
|
|
11
|
+
* Right-side axis (RTL): anchor end + negative dx shifts labels left of the line.
|
|
12
|
+
* Left-side axis (LTR): same anchor keeps labels in the margin to the left of the line.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getChartYAxisTickStyle(rtl: boolean): {
|
|
15
|
+
textAnchor: "end";
|
|
16
|
+
dx: number;
|
|
17
|
+
};
|
|
18
|
+
/** Space between X-axis category labels and the horizontal axis line. */
|
|
19
|
+
export declare const CHART_X_AXIS_TICK_MARGIN = 10;
|
|
20
|
+
/** Merges Recharts Y-axis tick SVG props (tick may also be a component or boolean). */
|
|
21
|
+
export declare function mergeYAxisTickProps(base: Record<string, unknown>, override: unknown, rtlStyle: ReturnType<typeof getChartYAxisTickStyle>): Record<string, unknown>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ColoredTagProps = {
|
|
2
|
+
/** Text shown inside the tag; also drives the derived color. */
|
|
3
|
+
label: string;
|
|
4
|
+
/** Renders larger sizing for mobile layouts. */
|
|
5
|
+
isMobile?: boolean;
|
|
6
|
+
/** When provided, shows a remove (×) button and calls this on click. */
|
|
7
|
+
onRemove?: () => void;
|
|
8
|
+
/** Accessible title/tooltip for the remove button. */
|
|
9
|
+
removeTitle?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Generic tag chip with a stable, near-unique color derived from its label.
|
|
13
|
+
* Same label always yields the same color across renders.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ColoredTag: ({ label, isMobile, onRemove, removeTitle }: ColoredTagProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type DynamicTagColors = {
|
|
2
|
+
color: string;
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
borderColor: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Derives a stable, near-unique color set for an arbitrary tag string.
|
|
8
|
+
*
|
|
9
|
+
* Unlike the predefined state maps, this hashes the full tag text into an HSL
|
|
10
|
+
* hue so every distinct tag gets its own color while staying consistent across
|
|
11
|
+
* renders (same tag -> same color).
|
|
12
|
+
*/
|
|
13
|
+
export declare const getDynamicTagColors: (tag: string) => DynamicTagColors;
|
|
@@ -28,7 +28,7 @@ interface useBCFormReturnFunctions {
|
|
|
28
28
|
validateForm: () => boolean;
|
|
29
29
|
onChange: (targetVal: string, e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
30
30
|
resetValidationStates: () => void;
|
|
31
|
-
renderField: (name: string, label: string, type: FieldType, readonly?: boolean, placeholder?: string, tooltip?: string, dynamicStyle?: SerializedStyles) => JSX.Element;
|
|
31
|
+
renderField: (name: string, label: string, type: FieldType, readonly?: boolean, placeholder?: string, tooltip?: string, dynamicStyle?: SerializedStyles, autoComplete?: string) => JSX.Element;
|
|
32
32
|
_renderFieldInput: (name: string, type: FieldType, readonly: boolean, placeholder: string) => JSX.Element;
|
|
33
33
|
onDroplistSelectionChange: (name: string, selectedKey?: string) => void;
|
|
34
34
|
renderDroplistField: (name: string, label: string, options: BCDropListOptionsType[], placeholder?: string, tooltip?: string, lang?: boolean, searchable?: boolean, labelStyle?: SerializedStyles, containerStyle?: SerializedStyles, loading?: boolean, noEmpty?: boolean, usePortal?: boolean) => JSX.Element;
|
package/src/lib/icon/bcicon.d.ts
CHANGED
|
@@ -446,4 +446,24 @@ export declare const BCIcons: {
|
|
|
446
446
|
height?: number | undefined;
|
|
447
447
|
fill?: string | undefined;
|
|
448
448
|
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
449
|
+
HelpCircle: ({ width, height, fill }: {
|
|
450
|
+
width?: number | undefined;
|
|
451
|
+
height?: number | undefined;
|
|
452
|
+
fill?: string | undefined;
|
|
453
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
454
|
+
SingleUser: ({ width, height, fill }: {
|
|
455
|
+
width?: number | undefined;
|
|
456
|
+
height?: number | undefined;
|
|
457
|
+
fill?: string | undefined;
|
|
458
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
459
|
+
ChatWithBubble: ({ width, height, fill }: {
|
|
460
|
+
width?: number | undefined;
|
|
461
|
+
height?: number | undefined;
|
|
462
|
+
fill?: string | undefined;
|
|
463
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
464
|
+
Clock2: ({ width, height, fill }: {
|
|
465
|
+
width?: number | undefined;
|
|
466
|
+
height?: number | undefined;
|
|
467
|
+
fill?: string | undefined;
|
|
468
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
449
469
|
};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BCDropListOptionsType } from '../constants/Droplist';
|
|
3
|
-
export declare const TagContainer: import("@emotion/styled").StyledComponent<{
|
|
4
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
-
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
6
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
2
|
export interface MultiSelectorProps {
|
|
8
3
|
onSelect: (value: string | undefined) => void;
|
|
9
4
|
options: BCDropListOptionsType[];
|
|
@@ -1,3 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
2
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
3
|
+
export interface RAlertDialogProps {
|
|
4
|
+
component?: React.ReactNode;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
cancelText?: string;
|
|
8
|
+
cancelCssStyle?: SerializedStyles;
|
|
9
|
+
cancelAction?: () => void;
|
|
10
|
+
confirmText?: string;
|
|
11
|
+
confirmCssStyle?: SerializedStyles;
|
|
12
|
+
confirmAction: () => void;
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
headerItemsPosition?: string;
|
|
16
|
+
disableTrigger?: boolean;
|
|
17
|
+
triggerCssStyle?: SerializedStyles;
|
|
18
|
+
open?: boolean;
|
|
19
|
+
onOpenChange?: (open: boolean) => void;
|
|
20
|
+
titleCssStyle?: SerializedStyles;
|
|
21
|
+
descriptionCssStyle?: SerializedStyles;
|
|
22
|
+
noTrigger?: boolean;
|
|
23
|
+
rtl?: boolean;
|
|
24
|
+
icon?: React.ReactNode;
|
|
25
|
+
iconBackgroundColor?: string;
|
|
26
|
+
noConfirmButton?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare const BCNewAlertDialog: ({ component, title, description, cancelText, cancelCssStyle, confirmText, confirmCssStyle, confirmAction, triggerCssStyle, headerItemsPosition, disableTrigger, open, onOpenChange, titleCssStyle, descriptionCssStyle, noTrigger, rtl, icon, iconBackgroundColor, noConfirmButton, cancelAction, }: RAlertDialogProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
export type RAlertDialogProps = {
|
|
4
|
-
component?: ReactNode;
|
|
5
|
-
title?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
cancelText?: string;
|
|
8
|
-
cancelCssStyle?: SerializedStyles;
|
|
9
|
-
cancelAction?: () => void;
|
|
10
|
-
confirmText?: string;
|
|
11
|
-
confirmCssStyle?: SerializedStyles;
|
|
12
|
-
confirmAction: () => void;
|
|
13
|
-
loading?: boolean;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
headerItemsPosition?: string;
|
|
16
|
-
disableTrigger?: boolean;
|
|
17
|
-
triggerCssStyle?: SerializedStyles;
|
|
18
|
-
open?: boolean;
|
|
19
|
-
onOpenChange?: (open: boolean) => void;
|
|
20
|
-
titleCssStyle?: SerializedStyles;
|
|
21
|
-
descriptionCssStyle?: SerializedStyles;
|
|
22
|
-
noTrigger?: boolean;
|
|
23
|
-
rtl?: boolean;
|
|
24
|
-
icon?: ReactNode;
|
|
25
|
-
iconBackgroundColor?: string;
|
|
26
|
-
noConfirmButton?: boolean;
|
|
27
|
-
};
|
|
1
|
+
export type { RAlertDialogProps } from './BCNewAlertDialog';
|
|
@@ -11,6 +11,7 @@ export interface BCTextboxProps {
|
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
maxLength?: number;
|
|
13
13
|
autoCompleteList?: string[];
|
|
14
|
+
autoComplete?: string;
|
|
14
15
|
onBlur?: (ev: ChangeEvent<HTMLInputElement>) => any;
|
|
15
16
|
onClick?: (ev: any) => any;
|
|
16
17
|
onFocus?: (ev: ChangeEvent<HTMLInputElement>) => any;
|
|
@@ -19,5 +20,5 @@ export interface BCTextboxProps {
|
|
|
19
20
|
export interface BCTextboxState {
|
|
20
21
|
showAutoComplete: boolean;
|
|
21
22
|
}
|
|
22
|
-
export declare const BCTextbox: ({ className, name, onChange, onKeyDown, onClick, value, type, disabled, placeholder, maxLength, autoCompleteList, onBlur, onFocus, inputStyle, }: BCTextboxProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const BCTextbox: ({ className, name, onChange, onKeyDown, onClick, value, type, disabled, placeholder, maxLength, autoCompleteList, autoComplete, onBlur, onFocus, inputStyle, }: BCTextboxProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
24
|
export default BCTextbox;
|