@jobber/components 8.25.2 → 8.26.1

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.
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  import type { AtlantisThemeContextProviderProps, AtlantisThemeContextValue } from "./types";
3
3
  export declare const atlantisThemeContextDefaultValues: AtlantisThemeContextValue;
4
- export declare function AtlantisThemeContextProvider({ children, dangerouslyOverrideTheme, dangerouslyOverrideTokens, }: AtlantisThemeContextProviderProps): React.JSX.Element;
4
+ export declare function AtlantisThemeContextProvider({ children, dangerouslyOverrideTheme, dangerouslyOverrideTokens, storageKey, }: AtlantisThemeContextProviderProps): React.JSX.Element;
5
5
  export declare function useAtlantisTheme(): AtlantisThemeContextValue;
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var AtlantisThemeContext = require('../AtlantisThemeContext-cjs.js');
4
- var updateTheme = require('../updateTheme-cjs.js');
5
4
  require('@jobber/design');
6
5
  require('react');
7
6
  require('../_commonjsHelpers-cjs.js');
@@ -19,5 +18,5 @@ require('../_setToString-cjs.js');
19
18
  exports.AtlantisThemeContextProvider = AtlantisThemeContext.AtlantisThemeContextProvider;
20
19
  exports.THEME_CHANGE_EVENT = AtlantisThemeContext.THEME_CHANGE_EVENT;
21
20
  exports.atlantisThemeContextDefaultValues = AtlantisThemeContext.atlantisThemeContextDefaultValues;
21
+ exports.updateTheme = AtlantisThemeContext.updateTheme;
22
22
  exports.useAtlantisTheme = AtlantisThemeContext.useAtlantisTheme;
23
- exports.updateTheme = updateTheme.updateTheme;
@@ -1,5 +1,4 @@
1
- export { A as AtlantisThemeContextProvider, T as THEME_CHANGE_EVENT, a as atlantisThemeContextDefaultValues, u as useAtlantisTheme } from '../AtlantisThemeContext-es.js';
2
- export { u as updateTheme } from '../updateTheme-es.js';
1
+ export { A as AtlantisThemeContextProvider, T as THEME_CHANGE_EVENT, a as atlantisThemeContextDefaultValues, b as updateTheme, u as useAtlantisTheme } from '../AtlantisThemeContext-es.js';
3
2
  import '@jobber/design';
4
3
  import 'react';
5
4
  import '../_commonjsHelpers-es.js';
@@ -0,0 +1,11 @@
1
+ import type { Theme } from "./types";
2
+ /**
3
+ * `useSyncExternalStore` source for the theme. `data-theme` on the document
4
+ * element is the source of truth: `updateTheme` writes it and dispatches
5
+ * `THEME_CHANGE_EVENT`, which this store subscribes to.
6
+ */
7
+ export declare const themeStore: {
8
+ readonly subscribe: (onStoreChange: () => void) => () => void;
9
+ readonly getSnapshot: () => Theme;
10
+ readonly getServerSnapshot: () => Theme;
11
+ };
@@ -32,6 +32,20 @@ export interface AtlantisThemeContextProviderProps extends PropsWithChildren {
32
32
  * **Important**: you should provide a constant or at least a memoized value for performance reasons.
33
33
  */
34
34
  readonly dangerouslyOverrideTokens?: OverrideTokens;
35
+ /**
36
+ * The `localStorage` key your app writes to when toggling the theme (e.g.
37
+ * `"jobber_theme"`). When set, the provider listens for `window` `storage`
38
+ * events on this key and applies theme changes signalled by other browser
39
+ * tabs. Writing to `localStorage` remains the app's responsibility; Atlantis
40
+ * only handles the listen-and-react side.
41
+ *
42
+ * Cross-tab sync is opt-in: omit this prop and no `storage` listener is added,
43
+ * preserving the previous within-tab-only behavior.
44
+ *
45
+ * Has no effect when `dangerouslyOverrideTheme` is set, since that provider
46
+ * is intentionally isolated from the shared theme store.
47
+ */
48
+ readonly storageKey?: string;
35
49
  }
36
50
  export type OverrideTokens = {
37
51
  [K in keyof typeof tokens]?: (typeof tokens)[K];
@@ -2,6 +2,6 @@ import type { Theme } from "./types";
2
2
  /**
3
3
  * Toggle the theme of the application. If subscribed, the tokens will be updated accordingly.
4
4
  * Will add data-theme="<newTheme>" to the <html> element.
5
- * Will dispatch a custom event "atlantis.toggle-theme" with the new theme for other providers to subscribe to.
5
+ * Will dispatch a custom event "atlantis.toggle-theme" that theme providers subscribe to.
6
6
  */
7
7
  export declare function updateTheme(theme: Theme): void;
@@ -340,9 +340,45 @@ var merge_1 = merge;
340
340
 
341
341
  var merge$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(merge_1);
342
342
 
343
+ var styles = {"staticThemeProviderWrapper":"P6HrDSaI0Ac-","overrideTokensWrapper":"j-NMCOBL3-E-","spinning":"iq03qkKnXBA-"};
344
+
343
345
  const THEME_CHANGE_EVENT = "atlantis.toggle-theme";
344
346
 
345
- var styles = {"staticThemeProviderWrapper":"P6HrDSaI0Ac-","overrideTokensWrapper":"j-NMCOBL3-E-","spinning":"iq03qkKnXBA-"};
347
+ /**
348
+ * `useSyncExternalStore` source for the theme. `data-theme` on the document
349
+ * element is the source of truth: `updateTheme` writes it and dispatches
350
+ * `THEME_CHANGE_EVENT`, which this store subscribes to.
351
+ */
352
+ const themeStore = {
353
+ subscribe(onStoreChange) {
354
+ globalThis.window.addEventListener(THEME_CHANGE_EVENT, onStoreChange);
355
+ return () => {
356
+ globalThis.window.removeEventListener(THEME_CHANGE_EVENT, onStoreChange);
357
+ };
358
+ },
359
+ getSnapshot() {
360
+ var _a, _b, _c, _d;
361
+ return ((_d = (_c = (_b = (_a = globalThis.document) === null || _a === void 0 ? void 0 : _a.documentElement) === null || _b === void 0 ? void 0 : _b.dataset) === null || _c === void 0 ? void 0 : _c.theme) !== null && _d !== void 0 ? _d : "light");
362
+ },
363
+ getServerSnapshot() {
364
+ return "light";
365
+ },
366
+ };
367
+
368
+ /**
369
+ * Toggle the theme of the application. If subscribed, the tokens will be updated accordingly.
370
+ * Will add data-theme="<newTheme>" to the <html> element.
371
+ * Will dispatch a custom event "atlantis.toggle-theme" that theme providers subscribe to.
372
+ */
373
+ function updateTheme(theme) {
374
+ if (!globalThis.window)
375
+ return;
376
+ globalThis.document.documentElement.setAttribute("data-theme", theme);
377
+ const event = new CustomEvent(THEME_CHANGE_EVENT, {
378
+ detail: { theme },
379
+ });
380
+ globalThis.window.dispatchEvent(event);
381
+ }
346
382
 
347
383
  const atlantisThemeContextDefaultValues = {
348
384
  theme: "light",
@@ -350,31 +386,35 @@ const atlantisThemeContextDefaultValues = {
350
386
  };
351
387
  const actualDarkTokens = merge$1({}, design.tokens, design.darkTokens);
352
388
  const AtlantisThemeContext = React.createContext(atlantisThemeContextDefaultValues);
353
- function AtlantisThemeContextProvider({ children, dangerouslyOverrideTheme, dangerouslyOverrideTokens, }) {
389
+ function AtlantisThemeContextProvider({ children, dangerouslyOverrideTheme, dangerouslyOverrideTokens, storageKey, }) {
354
390
  if (dangerouslyOverrideTheme) {
355
391
  return (React.createElement(InternalStaticThemeProvider, { dangerouslyOverrideTokens: dangerouslyOverrideTokens, dangerouslyOverrideTheme: dangerouslyOverrideTheme }, children));
356
392
  }
357
- return (React.createElement(InternalDynamicThemeProvider, { dangerouslyOverrideTokens: dangerouslyOverrideTokens }, children));
393
+ return (React.createElement(InternalDynamicThemeProvider, { dangerouslyOverrideTokens: dangerouslyOverrideTokens, storageKey: storageKey }, children));
358
394
  }
359
- function InternalDynamicThemeProvider({ children, dangerouslyOverrideTokens, }) {
360
- var _a;
361
- const initialTheme = (_a = globalThis.document.documentElement.dataset.theme) !== null && _a !== void 0 ? _a : "light";
362
- const [internalTheme, setInternalTheme] = React.useState(initialTheme);
363
- const { finalTokens, cssVariableOverrides } = useTokens(internalTheme, dangerouslyOverrideTokens);
364
- const handleThemeChangeEvent = React.useCallback((event) => {
365
- const newTheme = event.detail.theme;
366
- setInternalTheme(newTheme);
367
- }, []);
395
+ function InternalDynamicThemeProvider({ children, dangerouslyOverrideTokens, storageKey, }) {
396
+ const theme = React.useSyncExternalStore(themeStore.subscribe, themeStore.getSnapshot, themeStore.getServerSnapshot);
397
+ const { finalTokens, cssVariableOverrides } = useTokens(theme, dangerouslyOverrideTokens);
368
398
  React.useEffect(() => {
369
- if (!globalThis.window)
399
+ if (!storageKey || !globalThis.window)
370
400
  return;
371
- globalThis.window.addEventListener(THEME_CHANGE_EVENT, handleThemeChangeEvent);
401
+ function handleStorage(event) {
402
+ if (event.key !== storageKey)
403
+ return;
404
+ const next = event.newValue;
405
+ if (next !== "light" && next !== "dark")
406
+ return;
407
+ if (next === themeStore.getSnapshot())
408
+ return;
409
+ updateTheme(next);
410
+ }
411
+ globalThis.window.addEventListener("storage", handleStorage);
372
412
  return () => {
373
- globalThis.window.removeEventListener(THEME_CHANGE_EVENT, handleThemeChangeEvent);
413
+ globalThis.window.removeEventListener("storage", handleStorage);
374
414
  };
375
- }, [handleThemeChangeEvent]);
415
+ }, [storageKey]);
376
416
  return (React.createElement(AtlantisThemeContext.Provider, { value: {
377
- theme: internalTheme,
417
+ theme: theme,
378
418
  tokens: finalTokens,
379
419
  overrideTokens: dangerouslyOverrideTokens,
380
420
  } }, cssVariableOverrides ? (React.createElement("div", { className: styles.overrideTokensWrapper, style: cssVariableOverrides }, children)) : (children)));
@@ -419,4 +459,5 @@ function useTokens(theme, overrideTokens) {
419
459
  exports.AtlantisThemeContextProvider = AtlantisThemeContextProvider;
420
460
  exports.THEME_CHANGE_EVENT = THEME_CHANGE_EVENT;
421
461
  exports.atlantisThemeContextDefaultValues = atlantisThemeContextDefaultValues;
462
+ exports.updateTheme = updateTheme;
422
463
  exports.useAtlantisTheme = useAtlantisTheme;
@@ -1,11 +1,11 @@
1
1
  import { tokens, darkTokens } from '@jobber/design';
2
- import React__default, { createContext, useState, useCallback, useEffect, useContext, useMemo } from 'react';
2
+ import React__default, { createContext, useSyncExternalStore, useEffect, useContext, useMemo } from 'react';
3
3
  import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
4
4
  import { e as eq_1, c as _Stack } from './identity-es.js';
5
5
  import { _ as _baseAssignValue } from './_baseAssignValue-es.js';
6
6
  import { _ as _baseFor } from './_baseFor-es.js';
7
7
  import { _ as _copyObject, k as keysIn_1, a as _cloneBufferExports, b as _cloneTypedArray, c as _copyArray, d as _initCloneObject, i as isPlainObject_1 } from './keysIn-es.js';
8
- import { b as isArrayLike_1, i as isArguments_1, a as isArray_1, c as isBufferExports, j as isFunction_1, d as isTypedArray_1 } from './isTypedArray-es.js';
8
+ import { b as isArrayLike_1, i as isArguments_1, a as isArray_1, c as isBufferExports, k as isFunction_1, d as isTypedArray_1 } from './isTypedArray-es.js';
9
9
  import { i as isObjectLike_1, a as isObject_1 } from './isObjectLike-es.js';
10
10
  import { _ as _baseRest, a as _isIterateeCall } from './_isIterateeCall-es.js';
11
11
 
@@ -338,9 +338,45 @@ var merge_1 = merge;
338
338
 
339
339
  var merge$1 = /*@__PURE__*/getDefaultExportFromCjs(merge_1);
340
340
 
341
+ var styles = {"staticThemeProviderWrapper":"P6HrDSaI0Ac-","overrideTokensWrapper":"j-NMCOBL3-E-","spinning":"iq03qkKnXBA-"};
342
+
341
343
  const THEME_CHANGE_EVENT = "atlantis.toggle-theme";
342
344
 
343
- var styles = {"staticThemeProviderWrapper":"P6HrDSaI0Ac-","overrideTokensWrapper":"j-NMCOBL3-E-","spinning":"iq03qkKnXBA-"};
345
+ /**
346
+ * `useSyncExternalStore` source for the theme. `data-theme` on the document
347
+ * element is the source of truth: `updateTheme` writes it and dispatches
348
+ * `THEME_CHANGE_EVENT`, which this store subscribes to.
349
+ */
350
+ const themeStore = {
351
+ subscribe(onStoreChange) {
352
+ globalThis.window.addEventListener(THEME_CHANGE_EVENT, onStoreChange);
353
+ return () => {
354
+ globalThis.window.removeEventListener(THEME_CHANGE_EVENT, onStoreChange);
355
+ };
356
+ },
357
+ getSnapshot() {
358
+ var _a, _b, _c, _d;
359
+ return ((_d = (_c = (_b = (_a = globalThis.document) === null || _a === void 0 ? void 0 : _a.documentElement) === null || _b === void 0 ? void 0 : _b.dataset) === null || _c === void 0 ? void 0 : _c.theme) !== null && _d !== void 0 ? _d : "light");
360
+ },
361
+ getServerSnapshot() {
362
+ return "light";
363
+ },
364
+ };
365
+
366
+ /**
367
+ * Toggle the theme of the application. If subscribed, the tokens will be updated accordingly.
368
+ * Will add data-theme="<newTheme>" to the <html> element.
369
+ * Will dispatch a custom event "atlantis.toggle-theme" that theme providers subscribe to.
370
+ */
371
+ function updateTheme(theme) {
372
+ if (!globalThis.window)
373
+ return;
374
+ globalThis.document.documentElement.setAttribute("data-theme", theme);
375
+ const event = new CustomEvent(THEME_CHANGE_EVENT, {
376
+ detail: { theme },
377
+ });
378
+ globalThis.window.dispatchEvent(event);
379
+ }
344
380
 
345
381
  const atlantisThemeContextDefaultValues = {
346
382
  theme: "light",
@@ -348,31 +384,35 @@ const atlantisThemeContextDefaultValues = {
348
384
  };
349
385
  const actualDarkTokens = merge$1({}, tokens, darkTokens);
350
386
  const AtlantisThemeContext = createContext(atlantisThemeContextDefaultValues);
351
- function AtlantisThemeContextProvider({ children, dangerouslyOverrideTheme, dangerouslyOverrideTokens, }) {
387
+ function AtlantisThemeContextProvider({ children, dangerouslyOverrideTheme, dangerouslyOverrideTokens, storageKey, }) {
352
388
  if (dangerouslyOverrideTheme) {
353
389
  return (React__default.createElement(InternalStaticThemeProvider, { dangerouslyOverrideTokens: dangerouslyOverrideTokens, dangerouslyOverrideTheme: dangerouslyOverrideTheme }, children));
354
390
  }
355
- return (React__default.createElement(InternalDynamicThemeProvider, { dangerouslyOverrideTokens: dangerouslyOverrideTokens }, children));
391
+ return (React__default.createElement(InternalDynamicThemeProvider, { dangerouslyOverrideTokens: dangerouslyOverrideTokens, storageKey: storageKey }, children));
356
392
  }
357
- function InternalDynamicThemeProvider({ children, dangerouslyOverrideTokens, }) {
358
- var _a;
359
- const initialTheme = (_a = globalThis.document.documentElement.dataset.theme) !== null && _a !== void 0 ? _a : "light";
360
- const [internalTheme, setInternalTheme] = useState(initialTheme);
361
- const { finalTokens, cssVariableOverrides } = useTokens(internalTheme, dangerouslyOverrideTokens);
362
- const handleThemeChangeEvent = useCallback((event) => {
363
- const newTheme = event.detail.theme;
364
- setInternalTheme(newTheme);
365
- }, []);
393
+ function InternalDynamicThemeProvider({ children, dangerouslyOverrideTokens, storageKey, }) {
394
+ const theme = useSyncExternalStore(themeStore.subscribe, themeStore.getSnapshot, themeStore.getServerSnapshot);
395
+ const { finalTokens, cssVariableOverrides } = useTokens(theme, dangerouslyOverrideTokens);
366
396
  useEffect(() => {
367
- if (!globalThis.window)
397
+ if (!storageKey || !globalThis.window)
368
398
  return;
369
- globalThis.window.addEventListener(THEME_CHANGE_EVENT, handleThemeChangeEvent);
399
+ function handleStorage(event) {
400
+ if (event.key !== storageKey)
401
+ return;
402
+ const next = event.newValue;
403
+ if (next !== "light" && next !== "dark")
404
+ return;
405
+ if (next === themeStore.getSnapshot())
406
+ return;
407
+ updateTheme(next);
408
+ }
409
+ globalThis.window.addEventListener("storage", handleStorage);
370
410
  return () => {
371
- globalThis.window.removeEventListener(THEME_CHANGE_EVENT, handleThemeChangeEvent);
411
+ globalThis.window.removeEventListener("storage", handleStorage);
372
412
  };
373
- }, [handleThemeChangeEvent]);
413
+ }, [storageKey]);
374
414
  return (React__default.createElement(AtlantisThemeContext.Provider, { value: {
375
- theme: internalTheme,
415
+ theme: theme,
376
416
  tokens: finalTokens,
377
417
  overrideTokens: dangerouslyOverrideTokens,
378
418
  } }, cssVariableOverrides ? (React__default.createElement("div", { className: styles.overrideTokensWrapper, style: cssVariableOverrides }, children)) : (children)));
@@ -414,4 +454,4 @@ function useTokens(theme, overrideTokens) {
414
454
  };
415
455
  }
416
456
 
417
- export { AtlantisThemeContextProvider as A, THEME_CHANGE_EVENT as T, atlantisThemeContextDefaultValues as a, useAtlantisTheme as u };
457
+ export { AtlantisThemeContextProvider as A, THEME_CHANGE_EVENT as T, atlantisThemeContextDefaultValues as a, updateTheme as b, useAtlantisTheme as u };
@@ -13,7 +13,7 @@ import { c as _Stack } from './identity-es.js';
13
13
  import { _ as _copyObject, k as keysIn_1, e as _getPrototype, f as _cloneArrayBuffer, b as _cloneTypedArray, a as _cloneBufferExports, c as _copyArray, d as _initCloneObject, g as _assignValue, i as isPlainObject_1 } from './keysIn-es.js';
14
14
  import { a as _getTag } from './_getTag-es.js';
15
15
  import { b as _Symbol, i as isObjectLike_1, a as isObject_1 } from './isObjectLike-es.js';
16
- import { m as _nodeUtilExports, k as _baseUnary, c as isBufferExports, a as isArray_1 } from './isTypedArray-es.js';
16
+ import { m as _nodeUtilExports, j as _baseUnary, c as isBufferExports, a as isArray_1 } from './isTypedArray-es.js';
17
17
  import { _ as _baseFlatten } from './_baseFlatten-es.js';
18
18
  import { _ as _overRest, a as _setToString } from './_setToString-es.js';
19
19
  import { u as useAtlantisContext } from './AtlantisContext-es.js';
@@ -116,6 +116,46 @@ function ThemedComponent() {
116
116
  }
117
117
  ```
118
118
 
119
+ ### Cross-tab theme sync (Web Only)
120
+
121
+ The provider can keep the theme in sync across a user's open browser tabs. This
122
+ is opt-in: pass the `localStorage` key your app writes to as the `storageKey`
123
+ prop. The provider then listens for
124
+ [`storage` events](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event)
125
+ on that key and applies theme changes from other tabs. The `storage` event fires
126
+ only in tabs *other* than the one that wrote the value, so there's no feedback
127
+ loop.
128
+
129
+ **Your app is responsible for writing to `localStorage`** when the theme changes
130
+ — Atlantis only handles the listen-and-react side.
131
+
132
+ ```tsx
133
+ <AtlantisThemeContextProvider storageKey="my_app_theme">
134
+ <ThemedComponent />
135
+ </AtlantisThemeContextProvider>
136
+ ```
137
+
138
+ ```tsx
139
+ // Theme toggle — write to the same key after calling updateTheme
140
+ import { updateTheme } from "@jobber/components/AtlantisThemeContext";
141
+
142
+ function toggleTheme(newTheme: "light" | "dark") {
143
+ updateTheme(newTheme); // updates all providers in this tab immediately
144
+
145
+ try {
146
+ localStorage.setItem("my_app_theme", newTheme); // signals other tabs
147
+ } catch {
148
+ // localStorage unavailable (e.g. private mode) — degrades gracefully
149
+ }
150
+ }
151
+ ```
152
+
153
+ Omit `storageKey` and no `storage` listener is added, keeping the previous
154
+ within-tab-only behavior. Multiple dynamic providers on the same page all share
155
+ the same internal store, so a single provider with a `storageKey` is enough — a
156
+ cross-tab signal updates every dynamic provider at once. Providers mounted with
157
+ `dangerouslyOverrideTheme` are unaffected.
158
+
119
159
  ### Forcing a theme for an AtlantisThemeContextProvider
120
160
 
121
161
  In some scenarios you may want to force a theme for specific components
@@ -255,3 +295,4 @@ Key features:
255
295
  | `children` | `ReactNode` | Yes | — | The children to render. |
256
296
  | `dangerouslyOverrideTheme` | `Theme` | No | — | Force the theme for this provider to always be the same as the provided theme. Useful for sections that should remain... |
257
297
  | `dangerouslyOverrideTokens` | `OverrideTokens` | No | — | Overrides existing design tokens with custom values. Can also supply custom tokens which will be accessible via useAt... |
298
+ | `storageKey` | `string` | No | — | The `localStorage` key your app writes to when toggling the theme (e.g. `"jobber_theme"`). When set, the provider lis... |
@@ -33,10 +33,6 @@ numerical data (and their headers) round to the same decimal point, and are
33
33
  right-aligned. This makes it much easier for the reader to quickly parse large
34
34
  distinctions in dollar amounts, inventory counts, and other key business data.
35
35
 
36
- If you have a small list of information with a 1:1 label-to-data relationship
37
- (for example, the issued and due dates on an invoice), consider using
38
- [DescriptionList](../DescriptionList/DescriptionList.md).
39
-
40
36
  **Note**: The atomic DataTable components are the path forward and should be
41
37
  considered prior to using the [DataList](../DataList/DataList.md) and
42
38
  [Table](../Table/Table.md) components.
@@ -25,9 +25,7 @@ distinctions in dollar amounts, inventory counts, and other key business data.
25
25
 
26
26
  To list more complex collections of information (such as multi-line content like
27
27
  a detailed property address), you may want to consider the
28
- [List](../List/List.md) component. If you have a small list of information with
29
- a 1:1 label-to-data relationship (for example, the issued and due dates on an
30
- invoice), consider using [DescriptionList](../DescriptionList/DescriptionList.md).
28
+ [List](../List/List.md) component.
31
29
 
32
30
 
33
31
  ## Configuration
@@ -27,7 +27,6 @@
27
27
  [DataTable](./DataTable/DataTable.md)
28
28
  [Datepicker](./Datepicker/Datepicker.md)
29
29
  [DatePickerNotes](./DatePickerNotes/DatePickerNotes.md)
30
- [DescriptionList](./DescriptionList/DescriptionList.md)
31
30
  [Dialog](./Dialog/Dialog.md)
32
31
  [disabled-states](./disabled-states/disabled-states.md)
33
32
  [Disclosure](./Disclosure/Disclosure.md)
package/dist/index.cjs CHANGED
@@ -3,7 +3,6 @@
3
3
  var ActivityIndicator = require('./ActivityIndicator-cjs.js');
4
4
  var AtlantisContext = require('./AtlantisContext-cjs.js');
5
5
  var AtlantisThemeContext = require('./AtlantisThemeContext-cjs.js');
6
- var updateTheme = require('./updateTheme-cjs.js');
7
6
  var Autocomplete = require('./Autocomplete-cjs.js');
8
7
  var Avatar = require('./Avatar-cjs.js');
9
8
  var Banner = require('./Banner-cjs.js');
@@ -33,7 +32,6 @@ require('@jobber/hooks');
33
32
  require('./DataTableTable-cjs.js');
34
33
  var reactTable = require('@tanstack/react-table');
35
34
  var DatePicker = require('./DatePicker-cjs.js');
36
- var DescriptionList = require('./DescriptionList-cjs.js');
37
35
  var dialogReturnFocus = require('./dialogReturnFocus-cjs.js');
38
36
  var Disclosure = require('./Disclosure-cjs.js');
39
37
  var Divider = require('./Divider-cjs.js');
@@ -215,8 +213,8 @@ exports.useAtlantisContext = AtlantisContext.useAtlantisContext;
215
213
  exports.AtlantisThemeContextProvider = AtlantisThemeContext.AtlantisThemeContextProvider;
216
214
  exports.THEME_CHANGE_EVENT = AtlantisThemeContext.THEME_CHANGE_EVENT;
217
215
  exports.atlantisThemeContextDefaultValues = AtlantisThemeContext.atlantisThemeContextDefaultValues;
216
+ exports.updateTheme = AtlantisThemeContext.updateTheme;
218
217
  exports.useAtlantisTheme = AtlantisThemeContext.useAtlantisTheme;
219
- exports.updateTheme = updateTheme.updateTheme;
220
218
  exports.Autocomplete = Autocomplete.Autocomplete;
221
219
  exports.Avatar = Avatar.Avatar;
222
220
  exports.Banner = Banner.Banner;
@@ -249,7 +247,6 @@ Object.defineProperty(exports, "createColumnHelper", {
249
247
  get: function () { return reactTable.createColumnHelper; }
250
248
  });
251
249
  exports.DatePicker = DatePicker.DatePicker;
252
- exports.DescriptionList = DescriptionList.DescriptionList;
253
250
  exports.Dialog = dialogReturnFocus.Dialog;
254
251
  exports.getDialogReturnFocus = dialogReturnFocus.getDialogReturnFocus;
255
252
  exports.getFirstFocusableWithin = dialogReturnFocus.getFirstFocusableWithin;
package/dist/index.d.mts CHANGED
@@ -23,7 +23,6 @@ export * from "./DataDump";
23
23
  export * from "./DataList";
24
24
  export { DataTable, createColumnHelper } from "./DataTable";
25
25
  export * from "./DatePicker";
26
- export * from "./DescriptionList";
27
26
  export * from "./Dialog";
28
27
  export * from "./Disclosure";
29
28
  export * from "./Divider";
package/dist/index.d.ts CHANGED
@@ -23,7 +23,6 @@ export * from "./DataDump";
23
23
  export * from "./DataList";
24
24
  export { DataTable, createColumnHelper } from "./DataTable";
25
25
  export * from "./DatePicker";
26
- export * from "./DescriptionList";
27
26
  export * from "./Dialog";
28
27
  export * from "./Disclosure";
29
28
  export * from "./Divider";
package/dist/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  export { A as ActivityIndicator } from './ActivityIndicator-es.js';
2
2
  export { A as AtlantisContext, a as atlantisContextDefaultValues, u as useAtlantisContext } from './AtlantisContext-es.js';
3
- export { A as AtlantisThemeContextProvider, T as THEME_CHANGE_EVENT, a as atlantisThemeContextDefaultValues, u as useAtlantisTheme } from './AtlantisThemeContext-es.js';
4
- export { u as updateTheme } from './updateTheme-es.js';
3
+ export { A as AtlantisThemeContextProvider, T as THEME_CHANGE_EVENT, a as atlantisThemeContextDefaultValues, b as updateTheme, u as useAtlantisTheme } from './AtlantisThemeContext-es.js';
5
4
  export { A as Autocomplete } from './Autocomplete-es.js';
6
5
  export { A as Avatar } from './Avatar-es.js';
7
6
  export { B as Banner } from './Banner-es.js';
@@ -31,7 +30,6 @@ import '@jobber/hooks';
31
30
  import './DataTableTable-es.js';
32
31
  export { createColumnHelper } from '@tanstack/react-table';
33
32
  export { D as DatePicker } from './DatePicker-es.js';
34
- export { D as DescriptionList } from './DescriptionList-es.js';
35
33
  export { D as Dialog, g as getDialogReturnFocus, a as getFirstFocusableWithin } from './dialogReturnFocus-es.js';
36
34
  export { D as Disclosure } from './Disclosure-es.js';
37
35
  export { D as Divider } from './Divider-es.js';
@@ -586,4 +586,4 @@ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedA
586
586
 
587
587
  var isTypedArray_1 = isTypedArray;
588
588
 
589
- export { _isPrototype as _, isArray_1 as a, isArrayLike_1 as b, isBufferExports as c, isTypedArray_1 as d, _overArg as e, _getNative as f, _Map as g, _toSource as h, isArguments_1 as i, isFunction_1 as j, _baseUnary as k, isLength_1 as l, _nodeUtilExports as m };
589
+ export { _isPrototype as _, isArray_1 as a, isArrayLike_1 as b, isBufferExports as c, isTypedArray_1 as d, _overArg as e, _getNative as f, _Map as g, _toSource as h, isArguments_1 as i, _baseUnary as j, isFunction_1 as k, isLength_1 as l, _nodeUtilExports as m };
package/dist/styles.css CHANGED
@@ -10365,47 +10365,6 @@ h2.react-datepicker__current-month {
10365
10365
  color: var(--color-heading);
10366
10366
  }
10367
10367
 
10368
- .BkruJ2-bRWg- {
10369
- margin: 0;
10370
- }
10371
-
10372
- .tpCvfS7kyDQ- {
10373
- display: -ms-flexbox;
10374
- display: flex;
10375
- -ms-flex-wrap: wrap;
10376
- flex-wrap: wrap;
10377
- padding: 8px 0;
10378
- padding: var(--space-small) 0;
10379
- border-bottom: 1px solid hsl(200, 13%, 87%);
10380
- border-bottom: var(--border-base) solid var(--color-border);
10381
- }
10382
-
10383
- .tpCvfS7kyDQ-:first-child {
10384
- padding-top: 0;
10385
- }
10386
-
10387
- .tpCvfS7kyDQ-:last-child {
10388
- padding-bottom: 0;
10389
- border-bottom: none;
10390
- }
10391
-
10392
- .tpCvfS7kyDQ- dd {
10393
- min-width: calc(16px * 7.5);
10394
- min-width: calc(var(--base-unit) * 7.5);
10395
- box-sizing: border-box;
10396
- padding-right: 8px;
10397
- padding-right: var(--space-small);
10398
- -webkit-margin-start: 0;
10399
- margin-left: 0;
10400
- -ms-flex: 1 1 60%;
10401
- flex: 1 1 60%;
10402
- }
10403
-
10404
- .tpCvfS7kyDQ- dt {
10405
- -ms-flex: 1 1 40%;
10406
- flex: 1 1 40%;
10407
- }
10408
-
10409
10368
  /* Dialog Sizes */
10410
10369
  .uYYyCR3l6E8- {
10411
10370
  --dialog-popup-max-width: 440px;
@@ -3,7 +3,7 @@ import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
3
3
  import { _ as _baseFlatten } from './_baseFlatten-es.js';
4
4
  import { a as _arrayMap, b as _baseGet } from './_getAllKeys-es.js';
5
5
  import { _ as _baseEach, a as _baseIteratee } from './_baseEach-es.js';
6
- import { b as isArrayLike_1, k as _baseUnary, a as isArray_1 } from './isTypedArray-es.js';
6
+ import { b as isArrayLike_1, j as _baseUnary, a as isArray_1 } from './isTypedArray-es.js';
7
7
  import { i as isSymbol_1 } from './isSymbol-es.js';
8
8
  import { i as identity_1 } from './identity-es.js';
9
9
  import { _ as _baseRest, a as _isIterateeCall } from './_isIterateeCall-es.js';
@@ -69,7 +69,6 @@
69
69
  "DataTable.SortableHeader",
70
70
  "DataTable.Table",
71
71
  "DatePicker",
72
- "DescriptionList",
73
72
  "Dialog",
74
73
  "Dialog.Actions",
75
74
  "Dialog.Body",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "8.25.2",
3
+ "version": "8.26.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -150,11 +150,6 @@
150
150
  "import": "./dist/DatePicker/index.mjs",
151
151
  "require": "./dist/DatePicker/index.cjs"
152
152
  },
153
- "./DescriptionList": {
154
- "types": "./dist/DescriptionList/index.d.ts",
155
- "import": "./dist/DescriptionList/index.mjs",
156
- "require": "./dist/DescriptionList/index.cjs"
157
- },
158
153
  "./Dialog": {
159
154
  "types": "./dist/Dialog/index.d.ts",
160
155
  "import": "./dist/Dialog/index.mjs",
@@ -545,5 +540,5 @@
545
540
  "> 1%",
546
541
  "IE 10"
547
542
  ],
548
- "gitHead": "6ad9bdaf20469f010e018c70c5c2a1e4f061dbfe"
543
+ "gitHead": "f743b743aa382bf927e6f6959e99e0e8d25048dc"
549
544
  }
@@ -1 +0,0 @@
1
- export * from "./dist/DescriptionList";
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true,
5
- });
6
-
7
- var DescriptionList = require("./dist/DescriptionList");
8
-
9
- Object.keys(DescriptionList).forEach(function(key) {
10
- if (key === "default" || key === "__esModule") return;
11
- Object.defineProperty(exports, key, {
12
- enumerable: true,
13
- get: function get() {
14
- return DescriptionList[key];
15
- },
16
- });
17
- });
@@ -1,11 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import React from "react";
3
- interface DescriptionListProps {
4
- /**
5
- * A tuple where the first item is the string to display as the term
6
- * and the second value is the string to display as the definition
7
- */
8
- readonly data: [string, string | ReactNode][];
9
- }
10
- export declare function DescriptionList({ data }: DescriptionListProps): React.JSX.Element;
11
- export {};
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- var DescriptionList = require('../DescriptionList-cjs.js');
4
- require('react');
5
- require('../Typography-cjs.js');
6
- require('classnames');
7
-
8
-
9
-
10
- exports.DescriptionList = DescriptionList.DescriptionList;
@@ -1 +0,0 @@
1
- export { DescriptionList } from "./DescriptionList";
@@ -1,4 +0,0 @@
1
- export { D as DescriptionList } from '../DescriptionList-es.js';
2
- import 'react';
3
- import '../Typography-es.js';
4
- import 'classnames';
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var Typography = require('./Typography-cjs.js');
5
-
6
- var styles = {"descriptionList":"BkruJ2-bRWg-","termGroup":"tpCvfS7kyDQ-","spinning":"pkFPHChT5OI-"};
7
-
8
- function DescriptionList({ data }) {
9
- return (React.createElement("dl", { className: styles.descriptionList }, data.map(([term, description], i) => (React.createElement("div", { key: `${term}-${i}`, className: styles.termGroup },
10
- React.createElement(Typography.Typography, { element: "dt", textColor: "heading", size: "base" }, term),
11
- React.createElement(Typography.Typography, { element: "dd", textColor: "text", size: "base" }, description))))));
12
- }
13
-
14
- exports.DescriptionList = DescriptionList;
@@ -1,12 +0,0 @@
1
- import React__default from 'react';
2
- import { T as Typography } from './Typography-es.js';
3
-
4
- var styles = {"descriptionList":"BkruJ2-bRWg-","termGroup":"tpCvfS7kyDQ-","spinning":"pkFPHChT5OI-"};
5
-
6
- function DescriptionList({ data }) {
7
- return (React__default.createElement("dl", { className: styles.descriptionList }, data.map(([term, description], i) => (React__default.createElement("div", { key: `${term}-${i}`, className: styles.termGroup },
8
- React__default.createElement(Typography, { element: "dt", textColor: "heading", size: "base" }, term),
9
- React__default.createElement(Typography, { element: "dd", textColor: "text", size: "base" }, description))))));
10
- }
11
-
12
- export { DescriptionList as D };
@@ -1,25 +0,0 @@
1
- # Description List
2
-
3
- Description Lists are used to display a list of terms and descriptions.
4
-
5
- ## Design & usage guidelines
6
-
7
- The Description List is a great solution when you have a small list of
8
- information with a 1:1 label-to-data relationship. For example, the issued and
9
- due dates on an invoice, or the job type, billing type and duration of a job.
10
-
11
- ## Related components
12
-
13
- * To list more complex collections of related information, consider using a
14
- [List](../List/List.md).
15
- * To display structured data for comparison, consider using a
16
- [Table](../Table/Table.md).
17
-
18
-
19
- ## Props
20
-
21
- ### Web
22
-
23
- | Prop | Type | Required | Default | Description |
24
- |------|------|----------|---------|-------------|
25
- | `data` | `[string, ReactNode][]` | Yes | — | A tuple where the first item is the string to display as the term and the second value is the string to display as th... |
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- var AtlantisThemeContext = require('./AtlantisThemeContext-cjs.js');
4
-
5
- /**
6
- * Toggle the theme of the application. If subscribed, the tokens will be updated accordingly.
7
- * Will add data-theme="<newTheme>" to the <html> element.
8
- * Will dispatch a custom event "atlantis.toggle-theme" with the new theme for other providers to subscribe to.
9
- */
10
- function updateTheme(theme) {
11
- if (!globalThis.window)
12
- return;
13
- const event = new CustomEvent(AtlantisThemeContext.THEME_CHANGE_EVENT, {
14
- detail: { theme },
15
- });
16
- globalThis.document.documentElement.setAttribute("data-theme", theme);
17
- globalThis.window.dispatchEvent(event);
18
- }
19
-
20
- exports.updateTheme = updateTheme;
@@ -1,18 +0,0 @@
1
- import { T as THEME_CHANGE_EVENT } from './AtlantisThemeContext-es.js';
2
-
3
- /**
4
- * Toggle the theme of the application. If subscribed, the tokens will be updated accordingly.
5
- * Will add data-theme="<newTheme>" to the <html> element.
6
- * Will dispatch a custom event "atlantis.toggle-theme" with the new theme for other providers to subscribe to.
7
- */
8
- function updateTheme(theme) {
9
- if (!globalThis.window)
10
- return;
11
- const event = new CustomEvent(THEME_CHANGE_EVENT, {
12
- detail: { theme },
13
- });
14
- globalThis.document.documentElement.setAttribute("data-theme", theme);
15
- globalThis.window.dispatchEvent(event);
16
- }
17
-
18
- export { updateTheme as u };