@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,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pulls a component's class-level JSDoc description out of the generated Custom Elements
|
|
3
|
+
* Manifest, so each story's docs page description is sourced from the same `@slot`/`@part`
|
|
4
|
+
* JSDoc comment as the props table, instead of being duplicated by hand in the story file.
|
|
5
|
+
*/
|
|
6
|
+
export declare function componentDescription(tagName: string): string;
|
|
7
|
+
/** Same idea as componentDescription, but for one @Prop's own JSDoc comment (attribute-level). */
|
|
8
|
+
export declare function propDescription(tagName: string, propName: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function format(first?: string, middle?: string, last?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/loader/cdn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/cjs/loader.cjs.js');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/cjs/loader.cjs.js');
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from '../dist/types/components';
|
|
2
|
+
export interface CustomElementsDefineOptions {
|
|
3
|
+
exclude?: string[];
|
|
4
|
+
resourcesUrl?: string;
|
|
5
|
+
syncQueue?: boolean;
|
|
6
|
+
jmp?: (c: Function) => any;
|
|
7
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
8
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
9
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyPolyfills(): Promise<void>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
19
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
20
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
21
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
22
|
+
* will result in the same behavior.
|
|
23
|
+
*/
|
|
24
|
+
export declare function setNonce(nonce: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/esm/loader.js';
|
package/loader/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})();
|
|
2
|
+
export * from '../dist/esm/loader.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@brandsync/wc",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "Brandsync design system components as framework-agnostic Web Components",
|
|
8
|
+
"main": "dist/index.cjs.js",
|
|
9
|
+
"module": "dist/index.js",
|
|
10
|
+
"types": "dist/types/index.d.ts",
|
|
11
|
+
"collection": "dist/collection/collection-manifest.json",
|
|
12
|
+
"collection:main": "dist/collection/index.js",
|
|
13
|
+
"unpkg": "dist/brandsync-wc/brandsync-wc.esm.js",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/types/index.d.ts",
|
|
17
|
+
"import": "./dist/brandsync-wc/brandsync-wc.esm.js",
|
|
18
|
+
"require": "./dist/cjs/brandsync-wc.cjs.js"
|
|
19
|
+
},
|
|
20
|
+
"./dist/components": {
|
|
21
|
+
"import": "./dist/components/index.js",
|
|
22
|
+
"types": "./dist/components/index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./dist/components/*": {
|
|
25
|
+
"import": "./dist/components/*",
|
|
26
|
+
"types": "./dist/components/*"
|
|
27
|
+
},
|
|
28
|
+
"./dist/brandsync-wc/brandsync-wc.css": "./dist/brandsync-wc/brandsync-wc.css",
|
|
29
|
+
"./loader": {
|
|
30
|
+
"import": "./loader/index.js",
|
|
31
|
+
"require": "./loader/index.cjs",
|
|
32
|
+
"types": "./loader/index.d.ts"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/",
|
|
37
|
+
"loader/",
|
|
38
|
+
"custom-elements.json"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "stencil build",
|
|
42
|
+
"start": "stencil build --dev --watch --serve",
|
|
43
|
+
"test": "stencil build --prod && vitest run",
|
|
44
|
+
"test:watch": "stencil build --prod && vitest watch",
|
|
45
|
+
"generate": "stencil generate",
|
|
46
|
+
"storybook": "npm run build && storybook dev -p 6006",
|
|
47
|
+
"build-storybook": "npm run build && storybook build"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@stencil/angular-output-target": "^1.4.1",
|
|
51
|
+
"@stencil/core": "^4.27.1 || ^5.0.0-0",
|
|
52
|
+
"@stencil/react-output-target": "^1.6.2",
|
|
53
|
+
"@stencil/vitest": "^1.8.3",
|
|
54
|
+
"@storybook/addon-docs": "^10.5.8",
|
|
55
|
+
"@storybook/web-components-vite": "^10.5.8",
|
|
56
|
+
"@types/node": "^22.13.5",
|
|
57
|
+
"@vitest/browser-playwright": "^4.0.0",
|
|
58
|
+
"lit": "^3.3.3",
|
|
59
|
+
"playwright": "^1.52.0",
|
|
60
|
+
"storybook": "^10.5.8",
|
|
61
|
+
"vitest": "^4.0.0"
|
|
62
|
+
},
|
|
63
|
+
"license": "MIT",
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"brandsync-tokens": "^1.0.31"
|
|
66
|
+
}
|
|
67
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# @brandsync/wc
|
|
2
|
+
|
|
3
|
+
Brandsync's design system components as framework-agnostic Web Components — real, self-contained
|
|
4
|
+
custom elements consumed the same way by React, Angular, Blazor, or plain HTML. Built with
|
|
5
|
+
[Stencil](https://stenciljs.com), styled entirely from `brandsync-tokens` CSS Custom Properties.
|
|
6
|
+
|
|
7
|
+
See `CONVENTIONS.md` for the customization surface every component follows (CSS Custom Properties,
|
|
8
|
+
Shadow Parts, slots), and `docs/blazor-interop/` for a worked Blazor/MudBlazor consumption example.
|
|
9
|
+
|
|
10
|
+
## Getting started
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install
|
|
14
|
+
npm run build # compiles all components, generates React/Angular wrapper packages
|
|
15
|
+
npm test # runs the component test suite
|
|
16
|
+
npm run storybook # interactive component catalog at http://localhost:6006
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Typography
|
|
20
|
+
|
|
21
|
+
`brandsync-tokens` specifies Roboto (`--bs-typography-font-family-*`) and every component's shadow
|
|
22
|
+
styles inherit `font-family` from the document root — but **loading the actual Roboto font file is
|
|
23
|
+
the consuming app's job**, same convention already used across `eg-brandsync` (a Google Fonts
|
|
24
|
+
`<link>`, or `next/font/google` in Next.js apps). This library ships styling, not a font file.
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;400;500;600;700;900&display=swap">
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Those weights (100/400/500/600/700/900) match `brandsync-tokens`' `--bs-font-weight-*` scale
|
|
31
|
+
exactly. If Roboto isn't loaded, components still work — text just falls back to the browser's
|
|
32
|
+
default sans-serif.
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<script type="module" src="https://unpkg.com/@brandsync/wc"></script>
|
|
38
|
+
<bs-button variant="primary">Book room</bs-button>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Or from `node_modules`, per-component:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import '@brandsync/wc/dist/components/bs-button.js';
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
React and Angular get auto-generated wrapper packages (`@stencil/react-output-target` /
|
|
48
|
+
`@stencil/angular-output-target`) built from the same source — see `stencil.config.ts`.
|