@homebound/beam 3.108.1 → 4.0.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/Css.json +25 -1
- package/dist/chunk-CS45JYGW.js +63 -0
- package/dist/chunk-CS45JYGW.js.map +1 -0
- package/dist/index.cjs +20277 -20162
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +6 -6
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +2544 -2419
- package/dist/index.d.ts +2544 -2419
- package/dist/index.js +19757 -19587
- package/dist/index.js.map +1 -1
- package/dist/truss.css +52 -40
- package/dist/utils/rtlUtils.cjs +1 -4
- package/dist/utils/rtlUtils.cjs.map +1 -1
- package/dist/utils/rtlUtils.js +1 -1
- package/dist/utils/rtlUtils.js.map +1 -1
- package/package.json +62 -62
- package/dist/chunk-XPOPE37B.js +0 -125
- package/dist/chunk-XPOPE37B.js.map +0 -1
package/dist/Css.json
CHANGED
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
"typography": ["xs2","xs2Sb","xs","xsSb","sm","smSb","md","mdSb","lg","xl","xl2"],
|
|
5
5
|
"tokens": {"AiFieldBg":"--b-ai-field-bg","AiFieldFg":"--b-ai-field-fg","ButtonCautionDisabledBg":"--b-button-caution-disabled-bg","ButtonCautionDisabledFg":"--b-button-caution-disabled-fg","ButtonDangerDisabledBg":"--b-button-danger-disabled-bg","ButtonDangerDisabledFg":"--b-button-danger-disabled-fg","ButtonGhostDisabledFg":"--b-button-ghost-disabled-fg","ButtonGhostFg":"--b-button-ghost-fg","ButtonPrimaryDisabledBg":"--b-button-primary-disabled-bg","ButtonPrimaryDisabledFg":"--b-button-primary-disabled-fg","ButtonSecondaryFg":"--b-button-secondary-fg","ButtonTertiaryFg":"--b-button-tertiary-fg","ButtonTertiaryFgPressed":"--b-button-tertiary-fg-pressed","ChoiceDisabled":"--b-choice-disabled","ChoiceSelected":"--b-choice-selected","Danger":"--b-danger","DangerPressed":"--b-danger-pressed","EnvBrandDev":"--b-env-brand-dev","EnvBrandLocalProd":"--b-env-brand-local-prod","EnvBrandProd":"--b-env-brand-prod","EnvBrandQa":"--b-env-brand-qa","FieldBgDefault":"--b-field-bg-default","FieldBgDisabled":"--b-field-bg-disabled","FieldBgHover":"--b-field-bg-hover","FieldBorderDefault":"--b-field-border-default","FieldBorderError":"--b-field-border-error","FieldBorderFocus":"--b-field-border-focus","FieldBorderHover":"--b-field-border-hover","FieldTextDisabled":"--b-field-text-disabled","FocusRingInset":"--b-focus-ring-inset","FocusRingMuted":"--b-focus-ring-muted","LoaderFill":"--b-loader-fill","LoaderSpinner":"--b-loader-spinner","LoaderTrack":"--b-loader-track","NavGlobalItemBgActive":"--b-nav-global-item-bg-active","NavGlobalItemBgHover":"--b-nav-global-item-bg-hover","NavGlobalItemBgPressed":"--b-nav-global-item-bg-pressed","NavGlobalText":"--b-nav-global-text","NavGlobalTextActive":"--b-nav-global-text-active","NavGlobalTextDisabled":"--b-nav-global-text-disabled","NavItemBgActive":"--b-nav-item-bg-active","NavItemBgHover":"--b-nav-item-bg-hover","NavItemBgPressed":"--b-nav-item-bg-pressed","NavText":"--b-nav-text","NavTextActive":"--b-nav-text-active","NavTextDisabled":"--b-nav-text-disabled","NavTextFocusVisible":"--b-nav-text-focus-visible","NavTextPressed":"--b-nav-text-pressed","NeutralFillHover":"--b-neutral-fill-hover","NeutralFillHoverStrong":"--b-neutral-fill-hover-strong","NeutralFillHoverSubtle":"--b-neutral-fill-hover-subtle","NeutralFillPressed":"--b-neutral-fill-pressed","NeutralSurfacePressed":"--b-neutral-surface-pressed","OnPrimary":"--b-on-primary","OnSurface":"--b-on-surface","OnSurfaceDisabled":"--b-on-surface-disabled","OnSurfaceMuted":"--b-on-surface-muted","OnSurfaceRaisedHover":"--b-on-surface-raised-hover","OnSurfaceRaisedPressed":"--b-on-surface-raised-pressed","Primary":"--b-primary","PrimaryHover":"--b-primary-hover","PrimaryPressed":"--b-primary-pressed","Scrim":"--b-scrim","SelectionFill":"--b-selection-fill","SelectionIndicator":"--b-selection-indicator","Surface":"--b-surface","SurfaceDisabled":"--b-surface-disabled","SurfaceHover":"--b-surface-hover","SurfaceRaised":"--b-surface-raised","SurfaceRaisedHover":"--b-surface-raised-hover","SurfaceRaisedPressed":"--b-surface-raised-pressed","SurfaceSeparator":"--b-surface-separator","SurfaceSubtle":"--b-surface-subtle","TextDisabled":"--b-text-disabled","TextHelper":"--b-text-helper","TextLabel":"--b-text-label","TextLinkDefault":"--b-text-link-default","TextLinkDisabled":"--b-text-link-disabled","TextLinkHover":"--b-text-link-hover","TextLinkPressed":"--b-text-link-pressed","TextPlaceholder":"--b-text-placeholder","TextSelection":"--b-text-selection"},
|
|
6
6
|
"abbreviations": {
|
|
7
|
+
"animation": {"kind":"variable","props":["animation"],"incremented":false},
|
|
8
|
+
"animationDelay": {"kind":"variable","props":["animationDelay"],"incremented":false},
|
|
9
|
+
"animationDirection": {"kind":"variable","props":["animationDirection"],"incremented":false},
|
|
10
|
+
"animationDuration": {"kind":"variable","props":["animationDuration"],"incremented":false},
|
|
11
|
+
"animationFillMode": {"kind":"variable","props":["animationFillMode"],"incremented":false},
|
|
12
|
+
"animationIterationCount": {"kind":"variable","props":["animationIterationCount"],"incremented":false},
|
|
13
|
+
"animationName": {"kind":"variable","props":["animationName"],"incremented":false},
|
|
14
|
+
"animationPlayState": {"kind":"variable","props":["animationPlayState"],"incremented":false},
|
|
15
|
+
"animationTimingFunction": {"kind":"variable","props":["animationTimingFunction"],"incremented":false},
|
|
7
16
|
"ba": {"kind":"static","defs":{"borderStyle":"solid","borderWidth":"1px"}},
|
|
8
17
|
"bt": {"kind":"static","defs":{"borderTopStyle":"solid","borderTopWidth":"1px"}},
|
|
9
18
|
"br": {"kind":"static","defs":{"borderRightStyle":"solid","borderRightWidth":"1px"}},
|
|
@@ -805,6 +814,22 @@
|
|
|
805
814
|
"ttu": {"kind":"static","defs":{"textTransform":"uppercase"}},
|
|
806
815
|
"ttn": {"kind":"static","defs":{"textTransform":"none"}},
|
|
807
816
|
"tt": {"kind":"variable","props":["textTransform"],"incremented":false},
|
|
817
|
+
"backfaceVisibility": {"kind":"variable","props":["backfaceVisibility"],"incremented":false},
|
|
818
|
+
"perspective": {"kind":"variable","props":["perspective"],"incremented":false},
|
|
819
|
+
"perspectiveOrigin": {"kind":"variable","props":["perspectiveOrigin"],"incremented":false},
|
|
820
|
+
"rotate": {"kind":"variable","props":["rotate"],"incremented":false},
|
|
821
|
+
"scale": {"kind":"variable","props":["scale"],"incremented":false},
|
|
822
|
+
"transform": {"kind":"variable","props":["transform"],"incremented":false},
|
|
823
|
+
"transformBox": {"kind":"variable","props":["transformBox"],"incremented":false},
|
|
824
|
+
"transformOrigin": {"kind":"variable","props":["transformOrigin"],"incremented":false},
|
|
825
|
+
"transformStyle": {"kind":"variable","props":["transformStyle"],"incremented":false},
|
|
826
|
+
"translate": {"kind":"variable","props":["translate"],"incremented":false},
|
|
827
|
+
"transition": {"kind":"static","defs":{"transition":"background-color 200ms cubic-bezier(0.4, 0, 0.2, 1), border-color 200ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1), left 200ms cubic-bezier(0.4, 0, 0.2, 1), right 200ms cubic-bezier(0.4, 0, 0.2, 1), margin 200ms cubic-bezier(0.4, 0, 0.2, 1), width 200ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms cubic-bezier(0.4, 0, 0.2, 1)"}},
|
|
828
|
+
"transitionBehavior": {"kind":"variable","props":["transitionBehavior"],"incremented":false},
|
|
829
|
+
"transitionDelay": {"kind":"variable","props":["transitionDelay"],"incremented":false},
|
|
830
|
+
"transitionDuration": {"kind":"variable","props":["transitionDuration"],"incremented":false},
|
|
831
|
+
"transitionProperty": {"kind":"variable","props":["transitionProperty"],"incremented":false},
|
|
832
|
+
"transitionTimingFunction": {"kind":"variable","props":["transitionTimingFunction"],"incremented":false},
|
|
808
833
|
"xs2": {"kind":"static","defs":{"fontWeight":400,"fontSize":"10px","lineHeight":"14px"}},
|
|
809
834
|
"xs2Sb": {"kind":"static","defs":{"fontWeight":600,"fontSize":"10px","lineHeight":"14px"}},
|
|
810
835
|
"xs": {"kind":"static","defs":{"fontWeight":400,"fontSize":"12px","lineHeight":"16px"}},
|
|
@@ -914,7 +939,6 @@
|
|
|
914
939
|
"brt4": {"kind":"static","defs":{"borderTopRightRadius":"4px","borderTopLeftRadius":"4px"}},
|
|
915
940
|
"brb4": {"kind":"static","defs":{"borderBottomRightRadius":"4px","borderBottomLeftRadius":"4px"}},
|
|
916
941
|
"layoutContainer": {"kind":"static","defs":{"width":"min(100%, calc(calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px)) - 2 * var(--beam-layout-content-padding-x, 0px)))","left":"calc(var(--beam-side-nav-layout-width, 0px) + var(--beam-layout-content-padding-x, 0px))","position":"sticky"}},
|
|
917
|
-
"transition": {"kind":"static","defs":{"transition":"background-color 200ms cubic-bezier(0.4, 0, 0.2, 1), border-color 200ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1), left 200ms cubic-bezier(0.4, 0, 0.2, 1), right 200ms cubic-bezier(0.4, 0, 0.2, 1), margin 200ms cubic-bezier(0.4, 0, 0.2, 1), width 200ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms cubic-bezier(0.4, 0, 0.2, 1)"}},
|
|
918
942
|
"transitionWidth": {"kind":"static","defs":{"transition":"width 200ms cubic-bezier(0.4, 0, 0.2, 1)"}},
|
|
919
943
|
"transitionOpacity": {"kind":"static","defs":{"transition":"opacity 200ms cubic-bezier(0.4, 0, 0.2, 1)"}},
|
|
920
944
|
"transitionTransform": {"kind":"static","defs":{"transition":"transform 200ms cubic-bezier(0.4, 0, 0.2, 1)"}},
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// src/utils/helpers.ts
|
|
2
|
+
function fail(message) {
|
|
3
|
+
throw new Error(message || "Failed");
|
|
4
|
+
}
|
|
5
|
+
function toToggleState(isSelected, onChange) {
|
|
6
|
+
return {
|
|
7
|
+
isSelected,
|
|
8
|
+
defaultSelected: false,
|
|
9
|
+
setSelected: onChange,
|
|
10
|
+
toggle: () => onChange(!isSelected)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function maybeCall(callback, ...args) {
|
|
14
|
+
return callback && callback(...args);
|
|
15
|
+
}
|
|
16
|
+
function safeKeys(instance) {
|
|
17
|
+
return Object.getOwnPropertyNames(instance);
|
|
18
|
+
}
|
|
19
|
+
var omitKey = (key, { [key]: _, ...obj }) => obj;
|
|
20
|
+
var noop = (..._) => {
|
|
21
|
+
};
|
|
22
|
+
function safeEntries(obj) {
|
|
23
|
+
return Object.entries(obj);
|
|
24
|
+
}
|
|
25
|
+
var EmptyRef = class {
|
|
26
|
+
get current() {
|
|
27
|
+
throw new Error("BeamProvider is missing");
|
|
28
|
+
}
|
|
29
|
+
set current(_) {
|
|
30
|
+
throw new Error("BeamProvider is missing");
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var isAbsoluteUrl = (url) => /^(http(s?)):\/\//i.test(url);
|
|
34
|
+
function isPromise(obj) {
|
|
35
|
+
return typeof obj === "object" && "then" in obj && typeof obj.then === "function";
|
|
36
|
+
}
|
|
37
|
+
function isFunction(f) {
|
|
38
|
+
return typeof f === "function";
|
|
39
|
+
}
|
|
40
|
+
function isDefined(param) {
|
|
41
|
+
return param !== null && param !== void 0;
|
|
42
|
+
}
|
|
43
|
+
function pluralize(count, noun, pluralNoun) {
|
|
44
|
+
if ((Array.isArray(count) ? count.length : count) === 1) return noun;
|
|
45
|
+
return pluralNoun || `${noun}s`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
fail,
|
|
50
|
+
toToggleState,
|
|
51
|
+
maybeCall,
|
|
52
|
+
safeKeys,
|
|
53
|
+
omitKey,
|
|
54
|
+
noop,
|
|
55
|
+
safeEntries,
|
|
56
|
+
EmptyRef,
|
|
57
|
+
isAbsoluteUrl,
|
|
58
|
+
isPromise,
|
|
59
|
+
isFunction,
|
|
60
|
+
isDefined,
|
|
61
|
+
pluralize
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=chunk-CS45JYGW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/helpers.ts"],"sourcesContent":["import type { MutableRefObject } from \"react\";\nimport type { CheckboxGroupState, ToggleState } from \"react-stately\";\n\nexport function fail(message?: string): never {\n throw new Error(message || \"Failed\");\n}\n\n/** Adapts our state to what useToggleState returns in a stateless manner. */\nexport function toToggleState(isSelected: boolean, onChange: (value: boolean) => void): ToggleState {\n return {\n isSelected,\n defaultSelected: false,\n setSelected: onChange,\n toggle: () => onChange(!isSelected),\n };\n}\n\n/** Adapts our state to what use*Group returns in a stateless manner. */\nexport function toGroupState<T extends string>(values: T[], onChange: (value: T[]) => void): CheckboxGroupState {\n const addValue = (value: T) => onChange([...values, value]);\n const removeValue = (value: T) => onChange(values.filter((_value) => _value !== value));\n\n return {\n value: values,\n defaultValue: [],\n setValue: onChange,\n isSelected: (value: T) => values.includes(value),\n addValue,\n removeValue,\n toggleValue: (value: T) => (values.includes(value) ? addValue(value) : removeValue(value)),\n isDisabled: false,\n isReadOnly: false,\n // We do not use the validation state, as our Switch groups do not support error states. However, this field is required by the `CheckboxGroupState` so we need to include it.\n // If we ever update our SwitchGroup component to support error states, we'll need to update this.\n validationState: \"valid\",\n isInvalid: false,\n isRequired: false,\n setInvalid: () => {},\n realtimeValidation: { isInvalid: false, validationErrors: [], validationDetails: {} as ValidityState },\n displayValidation: { isInvalid: false, validationErrors: [], validationDetails: {} as ValidityState },\n updateValidation: () => {},\n resetValidation: () => {},\n commitValidation: () => {},\n };\n}\n\n/**\n * Utility to maybe call a function if undefined with arguments\n *\n * @example\n * maybeCall(onChange, true)\n * maybeCall(onBlur)\n * maybeCall(onSelect, { id: 1, value: \"book 1\"}, true)\n */\nexport function maybeCall(callback: Function | undefined, ...args: any[]) {\n return callback && callback(...args);\n}\n\n/** Casts `Object.keys` to \"what it should be\", as long as your instance doesn't have keys it shouldn't. */\nexport function safeKeys<T>(instance: T): (keyof T)[] {\n return Object.getOwnPropertyNames(instance) as any;\n}\n\n// Returns object with specified key removed\nexport const omitKey = <T, K extends keyof T>(key: K, { [key]: _, ...obj }: T) => obj as T;\n\nexport const noop = (..._: any) => {};\n\ntype Entries<T> = {\n [K in keyof T]: [K, T[K]];\n}[keyof T][];\n\nexport function safeEntries<T extends object>(obj: T): Entries<T> {\n return Object.entries(obj) as any;\n}\n\nexport class EmptyRef<T> implements MutableRefObject<T> {\n get current(): T {\n throw new Error(\"BeamProvider is missing\");\n }\n\n set current(_) {\n throw new Error(\"BeamProvider is missing\");\n }\n}\n\nexport const isAbsoluteUrl = (url: string) => /^(http(s?)):\\/\\//i.test(url);\n\nexport function areArraysEqual(a: any[], b: any[]): boolean {\n return a.length === b.length && a.every((val, idx) => val === b[idx]);\n}\n\nexport function isPromise(obj: any | Promise<any>): obj is Promise<any> {\n return typeof obj === \"object\" && \"then\" in obj && typeof obj.then === \"function\";\n}\n\nexport function isFunction(f: any): f is Function {\n return typeof f === \"function\";\n}\n\nexport function isDefined<T extends any>(param: T | undefined | null): param is T {\n return param !== null && param !== undefined;\n}\n\nexport function pluralize(count: number | unknown[], noun: string, pluralNoun?: string): string {\n if ((Array.isArray(count) ? count.length : count) === 1) return noun;\n return pluralNoun || `${noun}s`;\n}\n"],"mappings":";AAGO,SAAS,KAAK,SAAyB;AAC5C,QAAM,IAAI,MAAM,WAAW,QAAQ;AACrC;AAGO,SAAS,cAAc,YAAqB,UAAiD;AAClG,SAAO;AAAA,IACL;AAAA,IACA,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,QAAQ,MAAM,SAAS,CAAC,UAAU;AAAA,EACpC;AACF;AAuCO,SAAS,UAAU,aAAmC,MAAa;AACxE,SAAO,YAAY,SAAS,GAAG,IAAI;AACrC;AAGO,SAAS,SAAY,UAA0B;AACpD,SAAO,OAAO,oBAAoB,QAAQ;AAC5C;AAGO,IAAM,UAAU,CAAuB,KAAQ,EAAE,CAAC,MAAM,GAAG,GAAG,IAAI,MAAS;AAE3E,IAAM,OAAO,IAAI,MAAW;AAAC;AAM7B,SAAS,YAA8B,KAAoB;AAChE,SAAO,OAAO,QAAQ,GAAG;AAC3B;AAEO,IAAM,WAAN,MAAiD;AAAA,EACtD,IAAI,UAAa;AACf,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC3C;AAAA,EAEA,IAAI,QAAQ,GAAG;AACb,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC3C;AACF;AAEO,IAAM,gBAAgB,CAAC,QAAgB,oBAAoB,KAAK,GAAG;AAMnE,SAAS,UAAU,KAA8C;AACtE,SAAO,OAAO,QAAQ,YAAY,UAAU,OAAO,OAAO,IAAI,SAAS;AACzE;AAEO,SAAS,WAAW,GAAuB;AAChD,SAAO,OAAO,MAAM;AACtB;AAEO,SAAS,UAAyB,OAAyC;AAChF,SAAO,UAAU,QAAQ,UAAU;AACrC;AAEO,SAAS,UAAU,OAA2B,MAAc,YAA6B;AAC9F,OAAK,MAAM,QAAQ,KAAK,IAAI,MAAM,SAAS,WAAW,EAAG,QAAO;AAChE,SAAO,cAAc,GAAG,IAAI;AAC9B;","names":[]}
|