@bcrumbs.net/bc-ui 0.0.14 → 0.0.16

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/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.14",
4
+ "version": "0.0.16",
5
5
  "keyword": [
6
6
  "bcrumbs",
7
7
  "bc-ui"
8
8
  ],
9
9
  "peerDependencies": {
10
- "react": "18.3.1",
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,6 +41,8 @@ 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';
@@ -50,6 +52,7 @@ export type { RAlertDialogProps } from './lib/newComponents/BCNewAlertDialog/BCN
50
52
  export * from './lib/newComponents/BCNewDialog/BCNewDialog';
51
53
  export * from './lib/newComponents/BCRadioGroupItem/BCRadioItem';
52
54
  export * from './lib/newComponents/BCNewTabs/BCNewTabs';
55
+ export * from './lib/newComponents/BCInlineAlert/BCInlineAlert';
53
56
  export * from './lib/baseComponents/button';
54
57
  export * from './lib/sortableHeader/SortableHeader';
55
58
  export * from './lib/newComponents/BCNewTable/types';
@@ -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;
@@ -16,6 +16,7 @@ export declare enum NewColors {
16
16
  PRIMARY_PARAGRAPH_DARKER = "var(--bc-primary-paragraph-darker)",
17
17
  INBOX_BACKGROUND = "var(--bc-inbox-background)",
18
18
  BACKGROUND_DARKER = "var(--bc-background-darker)",
19
+ BACKGROUND_LIGHT = "var(--bc-background-light)",
19
20
  INFO_COLOR = "var(--bc-info)",
20
21
  INFO_LIGHT = "var(--bc-info-light)",
21
22
  FONT_COLOR = "#000",
@@ -37,7 +38,9 @@ export declare enum NewColors {
37
38
  DANGER_LIGHT = "var(--bc-danger-light)",
38
39
  SUCCESS = "var(--bc-success)",
39
40
  SUCCESS_DARKER = "var(--bc-success-darker)",
41
+ SUCCESS_DARKER_2 = "var(--bc-success-darker-2)",
40
42
  SUCCESS_LIGHT = "var(--bc-success-light)",
43
+ SUCCESS_LIGHT_2 = "var(--bc-success-light-2)",
41
44
  DROPDOWN_ITEM = "var(--bc-dropDown-item)",
42
45
  DROPDOWN_HOVER = "var(--bc-dropDown-hover)",
43
46
  SUB_SIDEBAR_TITLE = "var(--bc-sub-sidebar-title)",
@@ -51,6 +54,7 @@ export declare enum NewColors {
51
54
  SECONDARY_BORDER = "var(--bc-secondary-border)",
52
55
  CONTROLS = "var(--bc-controls)",
53
56
  FOREGROUND = "var(--bc-foreground)",
57
+ FOREGROUND_DARKER = "var(--bc-foreground-darker)",
54
58
  BACKGROUND = "var(--bc-background)",
55
59
  BACKGROUND_SECONDARY = "var(--bc-background-secondary)",
56
60
  PLACEHOLDER = "var(--bc-placeholder)",
@@ -4,5 +4,9 @@ export interface BCDropListOptionsType {
4
4
  styleClass?: string;
5
5
  value: string;
6
6
  note?: string;
7
+ /** When true, selecting the option is blocked (note can still be clickable via onNoteClick). */
8
+ disabled?: boolean;
9
+ /** Called when the note label is clicked (e.g. "Upgrade"). */
10
+ onNoteClick?: () => void;
7
11
  separator?: boolean;
8
12
  }
@@ -1,12 +1,14 @@
1
1
  export declare enum FontFamily {
2
2
  Main = "Montserrat",
3
3
  Secondary = "sans-serif",
4
- Poppins = "Poppins"
4
+ Poppins = "Poppins",
5
+ Inter = "Inter"
5
6
  }
6
7
  export declare enum FontFamilyStack {
7
8
  DEFAULT = "var(--bc-font-stack)",
8
9
  POPPINS_PRIMARY = "var(--bc-font-stack-poppins)",
9
10
  MONTSERRAT_PRIMARY = "var(--bc-font-stack-montserrat)",
11
+ INTER_PRIMARY = "var(--bc-font-stack-inter)",
10
12
  POPPINS_ONLY = "var(--bc-font-stack-primary)",
11
13
  MONTSERRAT_ONLY = "var(--bc-font-stack-secondary)"
12
14
  }
@@ -18,6 +18,7 @@ export declare const DropDownItemNote: import("@emotion/styled").StyledComponent
18
18
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
19
19
  } & {
20
20
  rtl?: boolean | undefined;
21
+ clickable?: boolean | undefined;
21
22
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
22
23
  export declare const Icon: import("@emotion/styled").StyledComponent<{
23
24
  theme?: import("@emotion/react").Theme | undefined;
@@ -26,6 +26,8 @@ export declare const BCIcons: {
26
26
  Facebook: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
27
27
  Telegram: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
28
28
  Google: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
29
+ ColoredGoogle: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
30
+ BCLogo: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
29
31
  Broadcast: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
30
32
  Bot: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
31
33
  FileExport: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -48,6 +50,7 @@ export declare const BCIcons: {
48
50
  Webhooks: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
49
51
  ConvLifecycle: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
50
52
  Channels: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
53
+ ShowPassword: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
51
54
  Flag: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
52
55
  RatingSettings: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
53
56
  CrumbySettings: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -461,4 +464,39 @@ export declare const BCIcons: {
461
464
  height?: number | undefined;
462
465
  fill?: string | undefined;
463
466
  }) => import("@emotion/react/jsx-runtime").JSX.Element;
467
+ Clock2: ({ width, height, fill }: {
468
+ width?: number | undefined;
469
+ height?: number | undefined;
470
+ fill?: string | undefined;
471
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
472
+ BroadcastChatChip: ({ width, height, fill }: {
473
+ width?: number | undefined;
474
+ height?: number | undefined;
475
+ fill?: string | undefined;
476
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
477
+ ChannelChatChip: ({ width, height, fill }: {
478
+ width?: number | undefined;
479
+ height?: number | undefined;
480
+ fill?: string | undefined;
481
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
482
+ InviteChatChip: ({ width, height, fill }: {
483
+ width?: number | undefined;
484
+ height?: number | undefined;
485
+ fill?: string | undefined;
486
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
487
+ AnalyzeChatChip: ({ width, height, fill }: {
488
+ width?: number | undefined;
489
+ height?: number | undefined;
490
+ fill?: string | undefined;
491
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
492
+ LongSingleCheck: ({ width, height, fill }: {
493
+ width?: number | undefined;
494
+ height?: number | undefined;
495
+ fill?: string | undefined;
496
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
497
+ WorkspacePanel: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
498
+ Checkout: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
499
+ AlertWarning: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
500
+ AlertError: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
501
+ AlertSuccess: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
464
502
  };
@@ -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[];
@@ -8,6 +8,8 @@ export type SubMenuItemsType = {
8
8
  tags?: string[];
9
9
  description?: string;
10
10
  hide?: boolean;
11
+ /** Permission keys (string-backed `Permission` enum values) required to see this sub-item. Empty/undefined = visible to all. */
12
+ requiredPermissions?: string[];
11
13
  };
12
14
  export type SubMenuType = {
13
15
  title?: string;
@@ -26,6 +28,8 @@ export type NavItem = {
26
28
  className?: string;
27
29
  subMenu?: Array<SubMenuType>;
28
30
  hide?: boolean;
31
+ /** Permission keys (string-backed `Permission` enum values) required to see this entry. Empty/undefined = visible to all. */
32
+ requiredPermissions?: string[];
29
33
  };
30
34
  export type NavWithTags = NavItem & {
31
35
  subMenu?: Array<SubMenuType>;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { SerializedStyles } from '@emotion/react';
3
+ export type BCInlineAlertVariant = 'info' | 'warning' | 'error' | 'success';
4
+ export type BCInlineAlertProps = {
5
+ /** Visual status of the alert. Controls accent bar, icon and colors. */
6
+ variant?: BCInlineAlertVariant;
7
+ /** Optional bold heading shown above the body. */
8
+ title?: React.ReactNode;
9
+ /** Message content. Multiple children stack vertically (e.g. text + link). */
10
+ children: React.ReactNode;
11
+ /** Override the default variant icon. */
12
+ icon?: React.ReactNode;
13
+ /** Hide the featured icon entirely. */
14
+ showIcon?: boolean;
15
+ /** Mirror layout for right-to-left languages (accent bar moves to the end). */
16
+ rtl?: boolean;
17
+ className?: string;
18
+ css?: SerializedStyles;
19
+ };
20
+ /**
21
+ * Generic inline alert / notification banner.
22
+ * White card with a colored accent bar and featured icon, driven by `variant`.
23
+ */
24
+ export declare const BCInlineAlert: React.FC<BCInlineAlertProps>;
25
+ export default BCInlineAlert;
@@ -30,5 +30,11 @@ export type RDropdownProps = {
30
30
  beforeActionsComponent?: ReactNode;
31
31
  afterActionsComponent?: ReactNode;
32
32
  rtl?: boolean;
33
+ /** Controlled open state — pass together with onOpenChange when the consumer must guarantee closing (e.g. items that navigate) */
34
+ open?: boolean;
33
35
  onOpenChange?: (open: boolean) => void;
36
+ /** When set, the actions list scrolls inside this max height (px) while footerActions stay pinned below */
37
+ actionsMaxHeight?: number;
38
+ /** Actions rendered after the scrollable area, preceded by a separator — always visible */
39
+ footerActions?: ActionItem[];
34
40
  };