@brandsync/wc 0.0.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.
- package/LICENSE +21 -0
- package/custom-elements.json +1138 -0
- package/dist/brandsync-wc/brandsync-wc.css +1730 -0
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -0
- package/dist/brandsync-wc/brandsync-wc.esm.js.map +1 -0
- package/dist/brandsync-wc/index-Cqxk7LcP.js.map +1 -0
- package/dist/brandsync-wc/index.esm.js +1 -0
- package/dist/brandsync-wc/index.esm.js.map +1 -0
- package/dist/brandsync-wc/p-042ad15a.entry.js +1 -0
- package/dist/brandsync-wc/p-2c4df28d.entry.js +1 -0
- package/dist/brandsync-wc/p-3134f5f5.entry.js +1 -0
- package/dist/brandsync-wc/p-5739acaf.entry.js +1 -0
- package/dist/brandsync-wc/p-BOj_41o9.js +3 -0
- package/dist/brandsync-wc/p-c2cc0d6f.entry.js +1 -0
- package/dist/brandsync-wc/p-da11e421.entry.js +1 -0
- package/dist/brandsync-wc/p-db3934d2.entry.js +1 -0
- package/dist/brandsync-wc/p-e38a9744.entry.js +1 -0
- package/dist/cjs/brandsync-wc.cjs.js +24 -0
- package/dist/cjs/bs-badge.cjs.entry.js +19 -0
- package/dist/cjs/bs-button-skeleton.cjs.entry.js +19 -0
- package/dist/cjs/bs-button.cjs.entry.js +88 -0
- package/dist/cjs/bs-card.cjs.entry.js +20 -0
- package/dist/cjs/bs-composer.cjs.entry.js +116 -0
- package/dist/cjs/bs-data-table.cjs.entry.js +62 -0
- package/dist/cjs/bs-input.cjs.entry.js +42 -0
- package/dist/cjs/bs-modal.cjs.entry.js +69 -0
- package/dist/cjs/index-nyOcuVbF.js +1710 -0
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/collection/collection-manifest.json +20 -0
- package/dist/collection/components/bs-badge/bs-badge.cmp.test.js +30 -0
- package/dist/collection/components/bs-badge/bs-badge.css +55 -0
- package/dist/collection/components/bs-badge/bs-badge.js +64 -0
- package/dist/collection/components/bs-badge/bs-badge.stories.js +75 -0
- package/dist/collection/components/bs-button/bs-button.cmp.test.js +81 -0
- package/dist/collection/components/bs-button/bs-button.css +247 -0
- package/dist/collection/components/bs-button/bs-button.js +242 -0
- package/dist/collection/components/bs-button/bs-button.stories.js +145 -0
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.cmp.test.js +18 -0
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.css +46 -0
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +73 -0
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.stories.js +25 -0
- package/dist/collection/components/bs-card/bs-card.cmp.test.js +42 -0
- package/dist/collection/components/bs-card/bs-card.css +31 -0
- package/dist/collection/components/bs-card/bs-card.js +70 -0
- package/dist/collection/components/bs-card/bs-card.stories.js +27 -0
- package/dist/collection/components/bs-composer/bs-composer.cmp.test.js +132 -0
- package/dist/collection/components/bs-composer/bs-composer.css +185 -0
- package/dist/collection/components/bs-composer/bs-composer.js +353 -0
- package/dist/collection/components/bs-composer/bs-composer.stories.js +66 -0
- package/dist/collection/components/bs-data-table/bs-data-table.css +56 -0
- package/dist/collection/components/bs-data-table/bs-data-table.js +259 -0
- package/dist/collection/components/bs-data-table/bs-data-table.stories.js +55 -0
- package/dist/collection/components/bs-input/bs-input.cmp.test.js +101 -0
- package/dist/collection/components/bs-input/bs-input.css +64 -0
- package/dist/collection/components/bs-input/bs-input.js +230 -0
- package/dist/collection/components/bs-input/bs-input.stories.js +40 -0
- package/dist/collection/components/bs-modal/bs-modal.cmp.test.js +112 -0
- package/dist/collection/components/bs-modal/bs-modal.css +66 -0
- package/dist/collection/components/bs-modal/bs-modal.js +198 -0
- package/dist/collection/components/bs-modal/bs-modal.stories.js +38 -0
- package/dist/collection/index.js +10 -0
- package/dist/collection/stories-utils.js +25 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/collection/utils/utils.unit.test.js +16 -0
- package/dist/components/bs-badge.d.ts +11 -0
- package/dist/components/bs-badge.js +1 -0
- package/dist/components/bs-button-skeleton.d.ts +11 -0
- package/dist/components/bs-button-skeleton.js +1 -0
- package/dist/components/bs-button.d.ts +11 -0
- package/dist/components/bs-button.js +1 -0
- package/dist/components/bs-card.d.ts +11 -0
- package/dist/components/bs-card.js +1 -0
- package/dist/components/bs-composer.d.ts +11 -0
- package/dist/components/bs-composer.js +1 -0
- package/dist/components/bs-data-table.d.ts +11 -0
- package/dist/components/bs-data-table.js +1 -0
- package/dist/components/bs-input.d.ts +11 -0
- package/dist/components/bs-input.js +1 -0
- package/dist/components/bs-modal.d.ts +11 -0
- package/dist/components/bs-modal.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-Cu4gTknX.js +1 -0
- package/dist/esm/brandsync-wc.js +20 -0
- package/dist/esm/bs-badge.entry.js +17 -0
- package/dist/esm/bs-button-skeleton.entry.js +17 -0
- package/dist/esm/bs-button.entry.js +86 -0
- package/dist/esm/bs-card.entry.js +18 -0
- package/dist/esm/bs-composer.entry.js +114 -0
- package/dist/esm/bs-data-table.entry.js +60 -0
- package/dist/esm/bs-input.entry.js +40 -0
- package/dist/esm/bs-modal.entry.js +67 -0
- package/dist/esm/index-BOj_41o9.js +1701 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/loader.js +10 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/bs-badge/bs-badge.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-badge/bs-badge.d.ts +20 -0
- package/dist/types/components/bs-badge/bs-badge.stories.d.ts +19 -0
- package/dist/types/components/bs-button/bs-button.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-button/bs-button.d.ts +84 -0
- package/dist/types/components/bs-button/bs-button.stories.d.ts +29 -0
- package/dist/types/components/bs-button-skeleton/bs-button-skeleton.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-button-skeleton/bs-button-skeleton.d.ts +28 -0
- package/dist/types/components/bs-button-skeleton/bs-button-skeleton.stories.d.ts +10 -0
- package/dist/types/components/bs-card/bs-card.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-card/bs-card.d.ts +26 -0
- package/dist/types/components/bs-card/bs-card.stories.d.ts +10 -0
- package/dist/types/components/bs-composer/bs-composer.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-composer/bs-composer.d.ts +83 -0
- package/dist/types/components/bs-composer/bs-composer.stories.d.ts +17 -0
- package/dist/types/components/bs-data-table/bs-data-table.d.ts +55 -0
- package/dist/types/components/bs-data-table/bs-data-table.stories.d.ts +7 -0
- package/dist/types/components/bs-input/bs-input.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-input/bs-input.d.ts +33 -0
- package/dist/types/components/bs-input/bs-input.stories.d.ts +15 -0
- package/dist/types/components/bs-modal/bs-modal.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-modal/bs-modal.d.ts +45 -0
- package/dist/types/components/bs-modal/bs-modal.stories.d.ts +9 -0
- package/dist/types/components.d.ts +962 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1872 -0
- package/dist/types/stories-utils.d.ts +8 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/types/utils/utils.unit.test.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +67 -0
- package/readme.md +48 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { g as globalScripts, b as bootstrapLazy } from './index-BOj_41o9.js';
|
|
2
|
+
export { s as setNonce } from './index-BOj_41o9.js';
|
|
3
|
+
|
|
4
|
+
const defineCustomElements = async (win, options) => {
|
|
5
|
+
if (typeof window === 'undefined') return undefined;
|
|
6
|
+
await globalScripts();
|
|
7
|
+
return bootstrapLazy([["bs-badge",[[769,"bs-badge",{"variant":[1]}]]],["bs-button",[[785,"bs-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1],"ariaLabel":[1,"aria-label"],"hasIcon":[32],"hasEndIcon":[32],"hasLabel":[32]}]]],["bs-button-skeleton",[[513,"bs-button-skeleton",{"size":[1]}]]],["bs-card",[[769,"bs-card",{"surface":[1]}]]],["bs-composer",[[529,"bs-composer",{"variant":[1],"placeholder":[1],"value":[1],"state":[1],"ariaLabel":[1,"aria-label"]}]]],["bs-data-table",[[513,"bs-data-table",{"columns":[16],"rows":[16],"sortColumn":[1,"sort-column"],"sortDirection":[1,"sort-direction"],"selectable":[4],"cellRenderer":[16],"selectedIds":[32]}]]],["bs-input",[[529,"bs-input",{"value":[1],"type":[1],"label":[1],"placeholder":[1],"description":[1],"error":[1],"disabled":[4]}]]],["bs-modal",[[769,"bs-modal",{"open":[1540],"heading":[1],"size":[1],"hasFooter":[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]]], options);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { defineCustomElements };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './esm/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type BsBadgeVariant = 'default' | 'primary' | 'success' | 'warning' | 'info' | 'error' | 'neutral' | 'inverse';
|
|
2
|
+
/**
|
|
3
|
+
* A small status or category pill, usually paired with a label or list item.
|
|
4
|
+
*
|
|
5
|
+
* ## When to use
|
|
6
|
+
* - Communicating a short, fixed status (e.g. "Active", "On leave") or category label.
|
|
7
|
+
*
|
|
8
|
+
* ## When not to use
|
|
9
|
+
* - As an interactive/clickable element — a badge is a label, not a control. Use a button
|
|
10
|
+
* or chip component if it needs to be clickable.
|
|
11
|
+
* - For long text — badges are sized for one or two words.
|
|
12
|
+
*
|
|
13
|
+
* @slot - Default slot: the badge's label text.
|
|
14
|
+
* @part container - The pill element.
|
|
15
|
+
*/
|
|
16
|
+
export declare class BsBadge {
|
|
17
|
+
/** Maps directly to the brandsync-tokens `--bs-badge-bg-*` / `--bs-badge-text-*` sets. */
|
|
18
|
+
variant: BsBadgeVariant;
|
|
19
|
+
render(): any;
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import type { BsBadgeVariant } from './bs-badge';
|
|
3
|
+
interface BsBadgeArgs {
|
|
4
|
+
variant: BsBadgeVariant;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
declare const meta: Meta<BsBadgeArgs>;
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<BsBadgeArgs>;
|
|
10
|
+
export declare const Primary: Story;
|
|
11
|
+
export declare const DefaultVariant: Story;
|
|
12
|
+
export declare const Success: Story;
|
|
13
|
+
export declare const Warning: Story;
|
|
14
|
+
export declare const Info: Story;
|
|
15
|
+
export declare const Error: Story;
|
|
16
|
+
export declare const Neutral: Story;
|
|
17
|
+
export declare const Inverse: Story;
|
|
18
|
+
export declare const AllVariants: Story;
|
|
19
|
+
export declare const LongText: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export type BsButtonVariant = 'primary' | 'neutral' | 'error' | 'subtle' | 'outlined' | 'success' | 'warning' | 'info';
|
|
2
|
+
export type BsButtonSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
/**
|
|
4
|
+
* A clickable action element for the single most important action in a given context.
|
|
5
|
+
*
|
|
6
|
+
* ## When to use
|
|
7
|
+
* - The primary call to action on a screen or within a card/modal (e.g. "Book room", "Confirm").
|
|
8
|
+
* - Secondary, lower-emphasis actions alongside it (use `variant="neutral"`).
|
|
9
|
+
* - `variant="error"` for destructive/irreversible actions (e.g. "Delete account") — per
|
|
10
|
+
* BrandSync guidance, destructive actions should always use the error variant, never
|
|
11
|
+
* `neutral`, so the visual weight matches the risk of the action.
|
|
12
|
+
*
|
|
13
|
+
* ## When not to use
|
|
14
|
+
* - For navigation between pages — use a link/nav component instead, a button implies an
|
|
15
|
+
* in-page action, not a destination change.
|
|
16
|
+
* - For more than one primary-emphasis action in the same view — pick one, demote the rest to
|
|
17
|
+
* `neutral`.
|
|
18
|
+
* - `error` purely for visual emphasis — it signals a destructive action to the user, so reserve
|
|
19
|
+
* it for actions that actually delete/revoke/undo something.
|
|
20
|
+
*
|
|
21
|
+
* @slot - Default slot: the button's label content.
|
|
22
|
+
* @slot icon - Optional leading icon, rendered before the label.
|
|
23
|
+
* @slot end-icon - Optional trailing icon, rendered after the label.
|
|
24
|
+
* @part icon - The icon wrapper element.
|
|
25
|
+
* @part label - The text label element.
|
|
26
|
+
* @part end-icon - The trailing icon wrapper element.
|
|
27
|
+
* @prop --bs-button-radius - Corner radius. Aliased to `--bs-border-radius-100` by default.
|
|
28
|
+
* @prop --bs-button-height-sm - Height at `size="sm"`. Aliased to `--bs-spacing-500`.
|
|
29
|
+
* @prop --bs-button-height-md - Height at `size="md"`. Aliased to `--bs-spacing-600`.
|
|
30
|
+
* @prop --bs-button-height-lg - Height at `size="lg"`. Aliased to `--bs-spacing-700`.
|
|
31
|
+
*/
|
|
32
|
+
export declare class BsButton {
|
|
33
|
+
el: HTMLElement;
|
|
34
|
+
/**
|
|
35
|
+
* Visual style. Maps directly to the brandsync-tokens `--bs-button-*` semantic set.
|
|
36
|
+
* `error` is for destructive/irreversible actions per BrandSync guidance, not a stronger
|
|
37
|
+
* emphasis alternative to `primary`.
|
|
38
|
+
*/
|
|
39
|
+
variant: BsButtonVariant;
|
|
40
|
+
/** Sizing scale. */
|
|
41
|
+
size: BsButtonSize;
|
|
42
|
+
/** Disables the button and applies the disabled token set. */
|
|
43
|
+
disabled: boolean;
|
|
44
|
+
/** Native `<button>` type. */
|
|
45
|
+
type: 'button' | 'submit' | 'reset';
|
|
46
|
+
/**
|
|
47
|
+
* Accessible name for the button. Required for icon-only usage (no visible label text via the
|
|
48
|
+
* default slot) so screen readers still announce what the button does. Stencil reflects this
|
|
49
|
+
* camelCase prop to the `aria-label` HTML attribute automatically.
|
|
50
|
+
*/
|
|
51
|
+
ariaLabel: string | null;
|
|
52
|
+
/** Tracks whether the `icon` slot has assigned content, so the icon/label gap only
|
|
53
|
+
* applies when there's actually an icon. */
|
|
54
|
+
hasIcon: boolean;
|
|
55
|
+
/** Tracks whether the `end-icon` slot has assigned content, so the icon/label gap only
|
|
56
|
+
* applies when there's actually a trailing icon. */
|
|
57
|
+
hasEndIcon: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Tracks whether the default (label) slot has assigned content, so an icon-only button can be
|
|
60
|
+
* styled/sized differently (see `bs-button--icon-only`).
|
|
61
|
+
*
|
|
62
|
+
* Known edge case (not fixed, same simplification `hasIcon`/similar flags elsewhere in this
|
|
63
|
+
* codebase already make): a default slot containing only whitespace (e.g. a lone space text
|
|
64
|
+
* node) still counts as `hasLabel = true`, since checking for assigned nodes doesn't
|
|
65
|
+
* distinguish whitespace-only text nodes from real content.
|
|
66
|
+
*/
|
|
67
|
+
hasLabel: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Computes the initial `hasIcon`/`hasEndIcon`/`hasLabel` state directly from the host's light
|
|
70
|
+
* DOM children, before first render.
|
|
71
|
+
*
|
|
72
|
+
* This can't be left to the `slotchange` handlers below alone: `slotchange` only fires when a
|
|
73
|
+
* slot's *assigned nodes* change, and a slot that starts out with zero assigned nodes and stays
|
|
74
|
+
* that way never fires it (nothing changed). Relying on `slotchange` alone left an icon-only
|
|
75
|
+
* button (default slot empty from the start) permanently stuck on its initial `hasLabel`
|
|
76
|
+
* default, so `bs-button--icon-only` never applied.
|
|
77
|
+
*/
|
|
78
|
+
componentWillLoad(): void;
|
|
79
|
+
private hasSlottedContent;
|
|
80
|
+
private onIconSlotchange;
|
|
81
|
+
private onEndIconSlotchange;
|
|
82
|
+
private onLabelSlotchange;
|
|
83
|
+
render(): any;
|
|
84
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import type { BsButtonVariant, BsButtonSize } from './bs-button';
|
|
3
|
+
interface BsButtonArgs {
|
|
4
|
+
variant: BsButtonVariant;
|
|
5
|
+
size: BsButtonSize;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
type: 'button' | 'submit' | 'reset';
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
declare const meta: Meta<BsButtonArgs>;
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<BsButtonArgs>;
|
|
13
|
+
export declare const Primary: Story;
|
|
14
|
+
export declare const Neutral: Story;
|
|
15
|
+
export declare const Subtle: Story;
|
|
16
|
+
export declare const Outlined: Story;
|
|
17
|
+
export declare const Success: Story;
|
|
18
|
+
export declare const Warning: Story;
|
|
19
|
+
export declare const Info: Story;
|
|
20
|
+
export declare const Error: Story;
|
|
21
|
+
export declare const Disabled: Story;
|
|
22
|
+
export declare const NeutralDisabled: Story;
|
|
23
|
+
export declare const Sizes: Story;
|
|
24
|
+
export declare const WithIcon: Story;
|
|
25
|
+
export declare const WithEndIcon: Story;
|
|
26
|
+
export declare const IconOnly: Story;
|
|
27
|
+
export declare const LongLabel: Story;
|
|
28
|
+
export declare const AllCombinations: Story;
|
|
29
|
+
export declare const Skeleton: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BsButtonSize } from '../bs-button/bs-button';
|
|
2
|
+
/**
|
|
3
|
+
* A shape-matched loading placeholder for `bs-button`, shown while the real label/action isn't
|
|
4
|
+
* known yet (e.g. still being fetched from an API). Sized to match `bs-button`'s `sm`/`md`/`lg`
|
|
5
|
+
* heights so layout doesn't shift once the real button renders.
|
|
6
|
+
*
|
|
7
|
+
* This is not a submit-in-progress spinner — that's a different concern (a button that's
|
|
8
|
+
* already rendered but waiting on an async action it triggered). Use this component only when
|
|
9
|
+
* the button itself doesn't exist yet.
|
|
10
|
+
*
|
|
11
|
+
* ## When to use
|
|
12
|
+
* - In place of a `bs-button` whose label/visibility depends on data that hasn't loaded yet.
|
|
13
|
+
*
|
|
14
|
+
* ## When not to use
|
|
15
|
+
* - While a button's own click handler is running (e.g. a submit request in flight) — render the
|
|
16
|
+
* real `bs-button` and show its own busy/spinner state instead.
|
|
17
|
+
*
|
|
18
|
+
* @part container - The pulsing placeholder element.
|
|
19
|
+
* @prop --bs-button-skeleton-height-sm - Height at `size="sm"`. Aliased to `--bs-spacing-500`.
|
|
20
|
+
* @prop --bs-button-skeleton-height-md - Height at `size="md"`. Aliased to `--bs-spacing-600`.
|
|
21
|
+
* @prop --bs-button-skeleton-height-lg - Height at `size="lg"`. Aliased to `--bs-spacing-700`.
|
|
22
|
+
* @prop --bs-button-skeleton-width - Placeholder width. Defaults to `96px`.
|
|
23
|
+
*/
|
|
24
|
+
export declare class BsButtonSkeleton {
|
|
25
|
+
/** Sizing scale, matching the `bs-button` size it stands in for. */
|
|
26
|
+
size: BsButtonSize;
|
|
27
|
+
render(): any;
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import type { BsButtonSize } from '../bs-button/bs-button';
|
|
3
|
+
interface BsButtonSkeletonArgs {
|
|
4
|
+
size: BsButtonSize;
|
|
5
|
+
}
|
|
6
|
+
declare const meta: Meta<BsButtonSkeletonArgs>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<BsButtonSkeletonArgs>;
|
|
9
|
+
export declare const Default: Story;
|
|
10
|
+
export declare const Sizes: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type BsCardSurface = 'base' | 'raised' | 'container';
|
|
2
|
+
/**
|
|
3
|
+
* A bounded surface for grouping related content — a summary, a form section, a list item.
|
|
4
|
+
*
|
|
5
|
+
* ## When to use
|
|
6
|
+
* - Grouping a self-contained piece of content that needs visual separation from the page
|
|
7
|
+
* background (e.g. a booking summary, a settings section).
|
|
8
|
+
*
|
|
9
|
+
* ## When not to use
|
|
10
|
+
* - As the only structural element on a page — cards group content, they don't replace layout.
|
|
11
|
+
* - For a dismissible/transient message — use a modal or a dedicated notification component.
|
|
12
|
+
*
|
|
13
|
+
* @slot header - Optional heading content above the body.
|
|
14
|
+
* @slot - Default slot: the card's main body content.
|
|
15
|
+
* @slot footer - Optional actions/content below the body (e.g. a button).
|
|
16
|
+
* @part container - The outer bordered surface element.
|
|
17
|
+
* @part header - The header wrapper.
|
|
18
|
+
* @part body - The body wrapper.
|
|
19
|
+
* @part footer - The footer wrapper.
|
|
20
|
+
*/
|
|
21
|
+
export declare class BsCard {
|
|
22
|
+
/** Maps to the brandsync-tokens `--bs-paper-bg-*` set — Brandsync's tokens don't have a
|
|
23
|
+
* dedicated "card" component yet, so this reuses the existing Paper surface tokens. */
|
|
24
|
+
surface: BsCardSurface;
|
|
25
|
+
render(): any;
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
interface BsCardArgs {
|
|
3
|
+
surface: 'base' | 'raised' | 'container';
|
|
4
|
+
}
|
|
5
|
+
declare const meta: Meta<BsCardArgs>;
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj<BsCardArgs>;
|
|
8
|
+
export declare const Raised: Story;
|
|
9
|
+
export declare const Base: Story;
|
|
10
|
+
export declare const Container: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export type BsComposerVariant = 'ai' | 'human';
|
|
3
|
+
export type BsComposerState = 'idle' | 'generating' | 'disabled' | 'recording';
|
|
4
|
+
/**
|
|
5
|
+
* A chat composer input for Genie AI-style conversational interfaces: a text field
|
|
6
|
+
* plus an attach button, a mic/voice-recording toggle, and a single primary action button whose
|
|
7
|
+
* icon and behavior change with `state` (send, stop generating, or confirm a voice recording).
|
|
8
|
+
*
|
|
9
|
+
* ## When to use
|
|
10
|
+
* - The message-entry bar for an AI chat/assistant or human support conversation.
|
|
11
|
+
*
|
|
12
|
+
* ## When not to use
|
|
13
|
+
* - A general-purpose text field — use `bs-input` instead; this component's layout and states are
|
|
14
|
+
* purpose-built for a chat composer, not a generic form field.
|
|
15
|
+
*
|
|
16
|
+
* @part attach - The "+" attach button.
|
|
17
|
+
* @part input - The native text `<input>`.
|
|
18
|
+
* @part mic - The secondary icon button (microphone, or the stop-recording square while `state="recording"`).
|
|
19
|
+
* @part action - The primary circular action button (send, stop, or confirm depending on `state`).
|
|
20
|
+
* @prop --bs-composer-radius - Corner radius of the container. Aliased to `--bs-border-radius-150`.
|
|
21
|
+
* @prop --bs-composer-button-radius - Corner radius of the attach/mic/action buttons. Aliased to `--bs-border-radius-100`.
|
|
22
|
+
* @prop --bs-composer-button-size - Width/height of the attach/mic/action buttons. Aliased to `--bs-spacing-600`.
|
|
23
|
+
* @prop --bs-composer-bg - Background of the pill container. Aliased to `--bs-input-bg-default`.
|
|
24
|
+
* @prop --bs-composer-border - Border color of the pill container. Aliased to `--bs-input-border-default`.
|
|
25
|
+
* @prop --bs-composer-border-focus - Border color when the text field has focus. Aliased to `--bs-input-border-focus`.
|
|
26
|
+
* @prop --bs-composer-action-bg - Background of the primary action button. Aliased to `--bs-color-primary-default`.
|
|
27
|
+
* @prop --bs-composer-action-bg-hover - Aliased to `--bs-color-primary-hover`.
|
|
28
|
+
* @prop --bs-composer-action-bg-pressed - Aliased to `--bs-color-primary-pressed`.
|
|
29
|
+
* @prop --bs-composer-action-bg-disabled - Aliased to `--bs-surface-action-disabled`.
|
|
30
|
+
* @prop --bs-composer-action-icon - Icon color on the primary action button. Aliased to `--bs-text-on-action`.
|
|
31
|
+
* @prop --bs-composer-action-icon-disabled - Aliased to `--bs-text-on-disabled`.
|
|
32
|
+
* @prop --bs-composer-attach-icon - Icon color of the attach button. Aliased to `--bs-icon-default`.
|
|
33
|
+
* @prop --bs-composer-mic-icon - Icon color of the mic/stop-recording button. Aliased to `--bs-icon-default`.
|
|
34
|
+
* @prop --bs-composer-mic-icon-disabled - Aliased to `--bs-icon-disabled`.
|
|
35
|
+
* @prop --bs-composer-subtle-hover - Background of the attach/mic buttons on hover (subtle-button treatment, same as `bs-button`'s `subtle` variant). Aliased to `--bs-color-neutral-container`.
|
|
36
|
+
* @prop --bs-composer-subtle-pressed - Background of the attach/mic buttons when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
37
|
+
*/
|
|
38
|
+
export declare class BsComposer {
|
|
39
|
+
/**
|
|
40
|
+
* Which flavor of composer this is: changes the *default* placeholder text (set `placeholder`
|
|
41
|
+
* directly to override it) and, per the Figma design, renders the container border dashed
|
|
42
|
+
* instead of solid for `'human'` -- a deliberate visual cue distinguishing a human-support
|
|
43
|
+
* composer from the AI one, not a layout/token difference.
|
|
44
|
+
*/
|
|
45
|
+
variant: BsComposerVariant;
|
|
46
|
+
/** Overrides the variant's default placeholder. */
|
|
47
|
+
placeholder?: string;
|
|
48
|
+
/** Current text value. Native `input` events don't cross the Shadow DOM boundary, so this
|
|
49
|
+
* component re-dispatches them as a `bsInput` custom event instead. */
|
|
50
|
+
value: string;
|
|
51
|
+
/**
|
|
52
|
+
* Which of the four mutually-exclusive composer states to render: `idle` (send, enabled),
|
|
53
|
+
* `generating` (stop, while the AI is responding), `disabled` (send, but not interactive), or
|
|
54
|
+
* `recording` (voice input in progress -- shows a waveform and a confirm action).
|
|
55
|
+
*/
|
|
56
|
+
state: BsComposerState;
|
|
57
|
+
/**
|
|
58
|
+
* Accessible name for the text field. This component has no visible `<label>` (chat composers
|
|
59
|
+
* don't show one in the design), so `ariaLabel` is the only way a consumer gives the textbox an
|
|
60
|
+
* accessible name -- set it in every real usage.
|
|
61
|
+
*/
|
|
62
|
+
ariaLabel: string | null;
|
|
63
|
+
/** Fires on every keystroke in the text field, with the current value. */
|
|
64
|
+
bsInput: EventEmitter<string>;
|
|
65
|
+
/** Fires when the primary action button is clicked while `state="idle"`. */
|
|
66
|
+
bsSubmit: EventEmitter<void>;
|
|
67
|
+
/** Fires when the primary action button is clicked while `state="generating"`. */
|
|
68
|
+
bsStop: EventEmitter<void>;
|
|
69
|
+
/** Fires when the primary action button is clicked while `state="recording"`. */
|
|
70
|
+
bsVoiceConfirm: EventEmitter<void>;
|
|
71
|
+
/** Fires when the "+" attach button is clicked. */
|
|
72
|
+
bsAttach: EventEmitter<void>;
|
|
73
|
+
/** Fires when the mic/stop-recording button is clicked. The consumer decides what that means
|
|
74
|
+
* (e.g. start recording when idle/generating, or stop recording when `state="recording"`). */
|
|
75
|
+
bsMicToggle: EventEmitter<void>;
|
|
76
|
+
private onInput;
|
|
77
|
+
private onAttachClick;
|
|
78
|
+
private onMicClick;
|
|
79
|
+
private onActionClick;
|
|
80
|
+
private actionLabel;
|
|
81
|
+
private renderActionIcon;
|
|
82
|
+
render(): any;
|
|
83
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import type { BsComposerVariant, BsComposerState } from './bs-composer';
|
|
3
|
+
interface BsComposerArgs {
|
|
4
|
+
variant: BsComposerVariant;
|
|
5
|
+
state: BsComposerState;
|
|
6
|
+
value: string;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
}
|
|
9
|
+
declare const meta: Meta<BsComposerArgs>;
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<BsComposerArgs>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const Human: Story;
|
|
14
|
+
export declare const Generating: Story;
|
|
15
|
+
export declare const Disabled: Story;
|
|
16
|
+
export declare const Recording: Story;
|
|
17
|
+
export declare const AllStates: Story;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export interface BsDataTableColumn {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
sortable?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type BsDataTableRow = Record<string, unknown> & {
|
|
8
|
+
id: string | number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A sortable, optionally row-selectable table for tabular data.
|
|
12
|
+
*
|
|
13
|
+
* `columns`, `rows`, and `cellRenderer` are JS-property-only — HTML attributes can only carry
|
|
14
|
+
* strings, so arrays/objects/functions must be set via `element.rows = [...]` etc., not as
|
|
15
|
+
* attributes. See CONVENTIONS.md.
|
|
16
|
+
*
|
|
17
|
+
* ## When to use
|
|
18
|
+
* - Comparing structured records across the same set of fields (a list of people, bookings, etc.).
|
|
19
|
+
*
|
|
20
|
+
* ## When not to use
|
|
21
|
+
* - A handful of unrelated key/value pairs — a simple list or card is lighter-weight.
|
|
22
|
+
* - Deeply nested/hierarchical data — this component renders one flat row per record.
|
|
23
|
+
*
|
|
24
|
+
* @part table - The `<table>` element.
|
|
25
|
+
* @part head - The `<thead>` element.
|
|
26
|
+
* @part body - The `<tbody>` element.
|
|
27
|
+
* @part row - Each `<tr>` in the body.
|
|
28
|
+
* @part header-cell - Each `<th>` in the header row.
|
|
29
|
+
* @part cell - Each `<td>` in a body row.
|
|
30
|
+
*/
|
|
31
|
+
export declare class BsDataTable {
|
|
32
|
+
/** Array prop -- must be set as a JS property (`el.columns = [...]`), not an HTML attribute,
|
|
33
|
+
* since attributes can only carry strings. See CONVENTIONS.md. */
|
|
34
|
+
columns: BsDataTableColumn[];
|
|
35
|
+
/** Array prop -- same JS-property-only rule as `columns`. */
|
|
36
|
+
rows: BsDataTableRow[];
|
|
37
|
+
sortColumn?: string;
|
|
38
|
+
sortDirection: 'asc' | 'desc';
|
|
39
|
+
selectable: boolean;
|
|
40
|
+
/** Optional custom cell renderer, e.g. for an actions column. Function props are JS-property-only,
|
|
41
|
+
* same as array props -- there is no attribute equivalent. Falls back to the raw cell value. */
|
|
42
|
+
cellRenderer?: (row: BsDataTableRow, column: BsDataTableColumn) => string;
|
|
43
|
+
bsSort: EventEmitter<{
|
|
44
|
+
column: string;
|
|
45
|
+
direction: 'asc' | 'desc';
|
|
46
|
+
}>;
|
|
47
|
+
bsRowSelect: EventEmitter<{
|
|
48
|
+
id: string | number;
|
|
49
|
+
selected: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
private selectedIds;
|
|
52
|
+
private onHeaderClick;
|
|
53
|
+
private onRowCheckboxChange;
|
|
54
|
+
render(): any;
|
|
55
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const Default: Story;
|
|
6
|
+
export declare const Selectable: Story;
|
|
7
|
+
export declare const WithCustomCellRenderer: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* A single-line text field with an optional label, description, and error state.
|
|
4
|
+
*
|
|
5
|
+
* ## When to use
|
|
6
|
+
* - Collecting a single line of free-text, email, password, or numeric input.
|
|
7
|
+
* - Pair with `error` for inline validation feedback tied to that specific field.
|
|
8
|
+
*
|
|
9
|
+
* ## When not to use
|
|
10
|
+
* - Multi-line text — this component has no `textarea` mode.
|
|
11
|
+
* - A fixed set of choices — use a select/radio/checkbox component instead of free text.
|
|
12
|
+
*
|
|
13
|
+
* @part label - The `<label>` element.
|
|
14
|
+
* @part control - The native `<input>` element.
|
|
15
|
+
* @part description - The helper text element (hidden when `error` is set).
|
|
16
|
+
* @part error - The error message element.
|
|
17
|
+
*/
|
|
18
|
+
export declare class BsInput {
|
|
19
|
+
/** Current value. Native `input`/`change` events don't cross the Shadow DOM boundary, so this
|
|
20
|
+
* component re-dispatches them as `bsInput`/`bsChange` custom events instead. */
|
|
21
|
+
value: string;
|
|
22
|
+
type: 'text' | 'email' | 'password' | 'number';
|
|
23
|
+
label?: string;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
error?: string;
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
bsInput: EventEmitter<string>;
|
|
29
|
+
bsChange: EventEmitter<string>;
|
|
30
|
+
private onInput;
|
|
31
|
+
private onChange;
|
|
32
|
+
render(): any;
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
interface BsInputArgs {
|
|
3
|
+
label: string;
|
|
4
|
+
placeholder: string;
|
|
5
|
+
description: string;
|
|
6
|
+
error: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const meta: Meta<BsInputArgs>;
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<BsInputArgs>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const WithDescription: Story;
|
|
14
|
+
export declare const WithError: Story;
|
|
15
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export type BsModalSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
/**
|
|
4
|
+
* An overlay dialog that interrupts the current flow for a focused task or confirmation.
|
|
5
|
+
* Closes itself on backdrop click, Escape, or its own close button, and emits `bsClose`.
|
|
6
|
+
*
|
|
7
|
+
* ## When to use
|
|
8
|
+
* - Confirming a consequential action (e.g. "Confirm booking") before it takes effect.
|
|
9
|
+
* - A short, focused task that doesn't warrant navigating to a new page.
|
|
10
|
+
*
|
|
11
|
+
* ## When not to use
|
|
12
|
+
* - For non-blocking status messages — use a toast/notification instead of interrupting the user.
|
|
13
|
+
* - For a long, multi-step flow — a full page or a dedicated route is usually a better fit than a
|
|
14
|
+
* modal that just gets taller and taller.
|
|
15
|
+
*
|
|
16
|
+
* @slot - Default slot: the dialog body content.
|
|
17
|
+
* @slot footer - Optional footer content (typically action buttons).
|
|
18
|
+
* @part backdrop - The full-viewport overlay behind the dialog.
|
|
19
|
+
* @part dialog - The dialog box itself.
|
|
20
|
+
* @part header - The header row (heading + close button).
|
|
21
|
+
* @part close - The close button.
|
|
22
|
+
* @part body - The body content wrapper.
|
|
23
|
+
* @part footer - The footer wrapper (only visible when the footer slot has content).
|
|
24
|
+
*/
|
|
25
|
+
export declare class BsModal {
|
|
26
|
+
/** Mutable + reflected so the component can close itself (backdrop click, Escape, close button)
|
|
27
|
+
* the same way a native `<dialog>` does, while still emitting `bsClose` for the consumer to react to. */
|
|
28
|
+
open: boolean;
|
|
29
|
+
heading?: string;
|
|
30
|
+
size: BsModalSize;
|
|
31
|
+
bsClose: EventEmitter<void>;
|
|
32
|
+
/** Tracks whether the `footer` slot has assigned content, so the footer bar (border + padding)
|
|
33
|
+
* only renders when there's actually something to put in it. */
|
|
34
|
+
hasFooter: boolean;
|
|
35
|
+
private onFooterSlotchange;
|
|
36
|
+
private dialogRef?;
|
|
37
|
+
private previouslyFocused?;
|
|
38
|
+
private wasOpen;
|
|
39
|
+
private close;
|
|
40
|
+
onKeydown(ev: KeyboardEvent): void;
|
|
41
|
+
private onBackdropClick;
|
|
42
|
+
onFocusIn(ev: FocusEvent): void;
|
|
43
|
+
componentDidRender(): void;
|
|
44
|
+
render(): any;
|
|
45
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
interface BsModalArgs {
|
|
3
|
+
heading: string;
|
|
4
|
+
size: 'sm' | 'md' | 'lg';
|
|
5
|
+
}
|
|
6
|
+
declare const meta: Meta<BsModalArgs>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<BsModalArgs>;
|
|
9
|
+
export declare const Default: Story;
|