@box/blueprint-web 12.139.0 → 13.1.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.
@@ -8863,6 +8863,38 @@ table.bp_inline_table_module_inlineTable--fc22e[data-modern=true] td:last-child,
8863
8863
  .bp_base_text_input_module_textInputContainerOuter--78f05 .bp_base_text_input_module_inlineError--78f05,.bp_base_text_input_module_textInputContainerOuter--78f05 .bp_base_text_input_module_subtext--78f05{
8864
8864
  margin-block-start:var(--text-input-inline-error-subtext-block-margin);
8865
8865
  }
8866
+
8867
+ .bp_progress_bar_module_reactAriaProgressBar--23af7{
8868
+ display:grid;
8869
+ grid-template-areas:"label value" "bar bar";
8870
+ grid-template-columns:1fr auto;
8871
+ }
8872
+ .bp_progress_bar_module_reactAriaProgressBar--23af7 .bp_progress_bar_module_bar--23af7{
8873
+ background:var(--progress-bar-track-bg);
8874
+ border-radius:var(--progress-bar-border-radius);
8875
+ forced-color-adjust:none;
8876
+ grid-area:bar;
8877
+ height:.375rem;
8878
+ overflow:hidden;
8879
+ will-change:transform;
8880
+ }
8881
+ .bp_progress_bar_module_reactAriaProgressBar--23af7 .bp_progress_bar_module_fill--23af7{
8882
+ background:var(--progress-bar-fill-bg);
8883
+ border-radius:var(--progress-bar-border-radius);
8884
+ height:100%;
8885
+ }
8886
+ .bp_progress_bar_module_reactAriaProgressBar--23af7[data-modern=false]{
8887
+ --progress-bar-border-radius:var(--radius-1);
8888
+ --progress-bar-track-bg:var(--surface-progress-bar-surface-brand-background);
8889
+ --progress-bar-fill-bg:var(--surface-nav-surface-brand-foreground);
8890
+ gap:var(--space-1);
8891
+ }
8892
+ .bp_progress_bar_module_reactAriaProgressBar--23af7[data-modern=true]{
8893
+ --progress-bar-border-radius:var(--bp-radius-02);
8894
+ --progress-bar-track-bg:var(--bp-surface-progress-bar-surface-brand-background);
8895
+ --progress-bar-fill-bg:var(--bp-surface-nav-surface-brand-foreground);
8896
+ gap:var(--bp-space-010);
8897
+ }
8866
8898
  .bp_chip_module_chip--15eb7[data-modern=false]{
8867
8899
  --chip-gap:var(--space-2);
8868
8900
  --chip-height:var(--size-8);
@@ -43,6 +43,7 @@ export * from './navigation-menu';
43
43
  export * from './page';
44
44
  export * from './page-section';
45
45
  export * from './password-input';
46
+ export * from './progress-bar';
46
47
  export * from './primitives/base-text-input';
47
48
  export * from './primitives/calendar';
48
49
  export * from './primitives/chips/filter-chip';
@@ -52,6 +52,7 @@ export { NavigationMenu } from './navigation-menu/index.js';
52
52
  export { Page } from './page/index.js';
53
53
  export { PageSection } from './page-section/index.js';
54
54
  export { PasswordInput } from './password-input/password-input.js';
55
+ export { ProgressBar } from './progress-bar/progress-bar.js';
55
56
  export { BaseTextInput } from './primitives/base-text-input/base-text-input.js';
56
57
  export { Calendar } from './primitives/calendar/calendar.js';
57
58
  export { CalendarDate, CalendarDateTime, DateFormatter, Time, ZonedDateTime } from './primitives/calendar/classes.util.js';
@@ -0,0 +1,2 @@
1
+ export { ProgressBar } from './progress-bar';
2
+ export type { ProgressBarProps } from './types';
@@ -0,0 +1,3 @@
1
+ import { type ProgressBarProps } from './types';
2
+ declare function ProgressBar({ ariaLabel, label, className, labelId, ...rest }: ProgressBarProps): import("react/jsx-runtime").JSX.Element;
3
+ export { ProgressBar };
@@ -0,0 +1,48 @@
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
+ import clsx from 'clsx';
3
+ import { ProgressBar as ProgressBar$1 } from 'react-aria-components';
4
+ import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
5
+ import { useUniqueId } from '../utils/useUniqueId.js';
6
+ import styles from './progress-bar.module.js';
7
+
8
+ function ProgressBar({
9
+ ariaLabel,
10
+ label,
11
+ className,
12
+ labelId,
13
+ ...rest
14
+ }) {
15
+ const resolvedLabelId = useUniqueId('progress-bar-label-', !labelId) || labelId;
16
+ const {
17
+ enableModernizedComponents
18
+ } = useBlueprintModernization();
19
+ return jsxs(Fragment, {
20
+ children: [label && jsx("div", {
21
+ className: "label",
22
+ id: resolvedLabelId,
23
+ children: label
24
+ }), jsx(ProgressBar$1, {
25
+ ...rest,
26
+ "aria-label": ariaLabel,
27
+ "aria-labelledby": label ? resolvedLabelId : undefined,
28
+ className: clsx(styles.reactAriaProgressBar, className),
29
+ "data-modern": enableModernizedComponents ? 'true' : 'false',
30
+ children: ({
31
+ percentage
32
+ }) => {
33
+ return jsx("div", {
34
+ className: styles.bar,
35
+ children: jsx("div", {
36
+ className: styles.fill,
37
+ "data-testid": "progress-bar-fill",
38
+ style: {
39
+ width: `${percentage}%`
40
+ }
41
+ })
42
+ });
43
+ }
44
+ })]
45
+ });
46
+ }
47
+
48
+ export { ProgressBar };
@@ -0,0 +1,4 @@
1
+ import '../index.css';
2
+ var styles = {"reactAriaProgressBar":"bp_progress_bar_module_reactAriaProgressBar--23af7","bar":"bp_progress_bar_module_bar--23af7","fill":"bp_progress_bar_module_fill--23af7"};
3
+
4
+ export { styles as default };
@@ -0,0 +1,20 @@
1
+ import { type ProgressBarProps as AriaProgressBarProps } from 'react-aria-components';
2
+ import { type ReactNode } from 'react';
3
+ type ProgressBarBaseProps = AriaProgressBarProps & {
4
+ /** Additional CSS class name(s) applied to the root element. */
5
+ className?: string;
6
+ /** Custom ID for the label element. When omitted, a unique ID is generated automatically. */
7
+ labelId?: string;
8
+ };
9
+ type ProgressBarWithAriaLabel = ProgressBarBaseProps & {
10
+ /** Accessible label for screen readers when no visible label is provided. */
11
+ ariaLabel: string;
12
+ label?: never;
13
+ };
14
+ type ProgressBarWithLabel = ProgressBarBaseProps & {
15
+ ariaLabel?: never;
16
+ /** Visible label element rendered above the progress bar. */
17
+ label: ReactNode;
18
+ };
19
+ export type ProgressBarProps = ProgressBarWithAriaLabel | ProgressBarWithLabel;
20
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "12.139.0",
3
+ "version": "13.1.0",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {
@@ -47,7 +47,7 @@
47
47
  "dependencies": {
48
48
  "@ariakit/react": "0.4.15",
49
49
  "@ariakit/react-core": "0.4.15",
50
- "@box/blueprint-web-assets": "^4.101.8",
50
+ "@box/blueprint-web-assets": "^4.101.10",
51
51
  "@internationalized/date": "^3.7.0",
52
52
  "@radix-ui/react-accordion": "1.1.2",
53
53
  "@radix-ui/react-checkbox": "1.0.4",
@@ -77,7 +77,7 @@
77
77
  "type-fest": "^3.2.0"
78
78
  },
79
79
  "devDependencies": {
80
- "@box/storybook-utils": "^0.16.45",
80
+ "@box/storybook-utils": "^0.16.47",
81
81
  "@figma/code-connect": "1.3.12",
82
82
  "@types/react": "^18.0.0",
83
83
  "@types/react-dom": "^18.0.0",