@synergy-design-system/react 1.0.2 → 1.2.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/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  This package provides [React.js](https://react.dev/) wrappers for [Synergy Web Components](https://github.com/synergy-design-system/synergy-design-system/tree/main/packages/components).
4
4
 
5
5
  This package aims for an improved UX when used in React applications:
6
+
6
7
  - Auto-completion
7
8
  - Event handling
8
9
 
@@ -29,14 +30,14 @@ The components will not display correctly without the needed theme. Please inclu
29
30
 
30
31
  ```tsx
31
32
  // main.tsx
32
- import { StrictMode } from 'react';
33
- import { createRoot } from 'react-dom/client';
34
- import { App } from './App';
33
+ import { StrictMode } from "react";
34
+ import { createRoot } from "react-dom/client";
35
+ import { App } from "./App";
35
36
 
36
37
  // Add this line to enable the light theme for your application
37
- import '@synergy-design-system/tokens/dist/themes/light.css';
38
+ import "@synergy-design-system/tokens/themes/light.css";
38
39
 
39
- createRoot(document.getElementById('root')!).render(
40
+ createRoot(document.getElementById("root")!).render(
40
41
  <StrictMode>
41
42
  <App />
42
43
  </StrictMode>,
@@ -48,10 +49,10 @@ createRoot(document.getElementById('root')!).render(
48
49
  You may now use the components by importing them from the `@synergy-design-system/react` package and rendering them in a react component.
49
50
 
50
51
  ```tsx
51
- import { SynButton } from '../dist';
52
+ import { SynButton } from "@synergy-design-system/react";
52
53
 
53
54
  export const MyButton = () => (
54
- <SynButton type="button" variant="primary">
55
+ <SynButton type="button" variant="filled">
55
56
  SynButton Example
56
57
  </SynButton>
57
58
  );
@@ -64,13 +65,13 @@ All events will be automatically set up to work without the need to attach event
64
65
  Just use them with the default react `onEVENT` prefix, where `EVENT` is the camelCased name of the event.
65
66
 
66
67
  ```tsx
67
- import { SynButton } from '../dist';
68
+ import { SynButton } from "@synergy-design-system/react";
68
69
 
69
70
  export const MyButton = () => (
70
71
  <SynButton
71
- onSynBlur={e => console.log('button blur event', e)}
72
- onSynFocus={e => console.log('button focus event', e)}
73
- onSynInvalid={e => console.log('button flagged as invalid', e)}
72
+ onSynBlur={e => console.log("button blur event", e)}
73
+ onSynFocus={e => console.log("button focus event", e)}
74
+ onSynInvalid={e => console.log("button flagged as invalid", e)}
74
75
  >
75
76
  SynButton Example
76
77
  </SynButton>
@@ -0,0 +1,20 @@
1
+ // ../react/src/components/tag.ts
2
+ import * as React from "react";
3
+ import { createComponent } from "@lit/react";
4
+ import Component from "@synergy-design-system/components/components/tag/tag.component.js";
5
+ var tagName = "syn-tag";
6
+ Component.define("syn-tag");
7
+ var SynTag = createComponent({
8
+ displayName: "SynTag",
9
+ elementClass: Component,
10
+ events: {
11
+ onSynRemove: "syn-remove"
12
+ },
13
+ react: React,
14
+ tagName
15
+ });
16
+
17
+ export {
18
+ SynTag
19
+ };
20
+ //# sourceMappingURL=chunk.7T7PO2AE.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/tag.ts"],
4
+ "sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED @synergy-design-system/react wrappers for @synergy-design-system/components\n// Please do not edit this file directly!\n// It will get recreated when running pnpm build.\n// ---------------------------------------------------------------------\nimport * as React from 'react';\nimport { createComponent } from '@lit/react';\nimport Component from '@synergy-design-system/components/components/tag/tag.component.js';\n\nimport { type EventName } from '@lit/react';\nimport type { SynRemoveEvent } from '@synergy-design-system/components';\n\nconst tagName = 'syn-tag';\nComponent.define('syn-tag');\n\n/**\n * @summary Tags are used as labels to organize things or to indicate a selection.\n * @documentation https://synergy.style/components/tag\n * @status stable\n * @since 2.0\n *\n * @dependency syn-icon-button\n *\n * @slot - The tag's content.\n *\n * @event syn-remove - Emitted when the remove button is activated.\n *\n * @csspart base - The component's base wrapper.\n * @csspart content - The tag's content.\n * @csspart remove-button - The tag's remove button, an `<syn-icon-button>`.\n * @csspart remove-button__base - The remove button's exported `base` part.\n */\nexport const SynTag = createComponent({\n displayName: 'SynTag',\n elementClass: Component,\n events: {\n onSynRemove: 'syn-remove' as EventName<SynRemoveEvent>,\n },\n react: React,\n tagName,\n});\n\nexport type { SynRemoveEvent } from '@synergy-design-system/components';\n"],
5
+ "mappings": ";AAKA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAChC,OAAO,eAAe;AAKtB,IAAM,UAAU;AAChB,UAAU,OAAO,SAAS;AAmBnB,IAAM,SAAS,gBAAgB;AAAA,EACpC,aAAa;AAAA,EACb,cAAc;AAAA,EACd,QAAQ;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA,OAAO;AAAA,EACP;AACF,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,21 @@
1
+ // ../react/src/components/icon-button.ts
2
+ import * as React from "react";
3
+ import { createComponent } from "@lit/react";
4
+ import Component from "@synergy-design-system/components/components/icon-button/icon-button.component.js";
5
+ var tagName = "syn-icon-button";
6
+ Component.define("syn-icon-button");
7
+ var SynIconButton = createComponent({
8
+ displayName: "SynIconButton",
9
+ elementClass: Component,
10
+ events: {
11
+ onSynBlur: "syn-blur",
12
+ onSynFocus: "syn-focus"
13
+ },
14
+ react: React,
15
+ tagName
16
+ });
17
+
18
+ export {
19
+ SynIconButton
20
+ };
21
+ //# sourceMappingURL=chunk.W4YO4ERO.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/icon-button.ts"],
4
+ "sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED @synergy-design-system/react wrappers for @synergy-design-system/components\n// Please do not edit this file directly!\n// It will get recreated when running pnpm build.\n// ---------------------------------------------------------------------\nimport * as React from 'react';\nimport { createComponent } from '@lit/react';\nimport Component from '@synergy-design-system/components/components/icon-button/icon-button.component.js';\n\nimport { type EventName } from '@lit/react';\nimport type { SynBlurEvent, SynFocusEvent } from '@synergy-design-system/components';\n\nconst tagName = 'syn-icon-button';\nComponent.define('syn-icon-button');\n\n/**\n * @summary Icons buttons are simple, icon-only buttons that can be used for actions and in toolbars.\n * @documentation https://synergy.style/components/icon-button\n * @status stable\n * @since 2.0\n *\n * @dependency syn-icon\n *\n * @event syn-blur - Emitted when the icon button loses focus.\n * @event syn-focus - Emitted when the icon button gains focus.\n *\n * @csspart base - The component's base wrapper.\n */\nexport const SynIconButton = createComponent({\n displayName: 'SynIconButton',\n elementClass: Component,\n events: {\n onSynBlur: 'syn-blur' as EventName<SynBlurEvent>,\n onSynFocus: 'syn-focus' as EventName<SynFocusEvent>,\n },\n react: React,\n tagName,\n});\n\nexport type { SynBlurEvent } from '@synergy-design-system/components';\nexport type { SynFocusEvent } from '@synergy-design-system/components';\n"],
5
+ "mappings": ";AAKA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAChC,OAAO,eAAe;AAKtB,IAAM,UAAU;AAChB,UAAU,OAAO,iBAAiB;AAe3B,IAAM,gBAAgB,gBAAgB;AAAA,EAC3C,aAAa;AAAA,EACb,cAAc;AAAA,EACd,QAAQ;AAAA,IACN,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,OAAO;AAAA,EACP;AACF,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,22 @@
1
+ import Component from '@synergy-design-system/components/components/icon-button/icon-button.component.js';
2
+ import { type EventName } from '@lit/react';
3
+ import type { SynBlurEvent, SynFocusEvent } from '@synergy-design-system/components';
4
+ /**
5
+ * @summary Icons buttons are simple, icon-only buttons that can be used for actions and in toolbars.
6
+ * @documentation https://synergy.style/components/icon-button
7
+ * @status stable
8
+ * @since 2.0
9
+ *
10
+ * @dependency syn-icon
11
+ *
12
+ * @event syn-blur - Emitted when the icon button loses focus.
13
+ * @event syn-focus - Emitted when the icon button gains focus.
14
+ *
15
+ * @csspart base - The component's base wrapper.
16
+ */
17
+ export declare const SynIconButton: import("@lit/react").ReactWebComponent<Component, {
18
+ onSynBlur: EventName<SynBlurEvent>;
19
+ onSynFocus: EventName<SynFocusEvent>;
20
+ }>;
21
+ export type { SynBlurEvent } from '@synergy-design-system/components';
22
+ export type { SynFocusEvent } from '@synergy-design-system/components';
@@ -0,0 +1,7 @@
1
+ import {
2
+ SynIconButton
3
+ } from "../chunks/chunk.W4YO4ERO.js";
4
+ export {
5
+ SynIconButton
6
+ };
7
+ //# sourceMappingURL=icon-button.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,24 @@
1
+ import Component from '@synergy-design-system/components/components/tag/tag.component.js';
2
+ import { type EventName } from '@lit/react';
3
+ import type { SynRemoveEvent } from '@synergy-design-system/components';
4
+ /**
5
+ * @summary Tags are used as labels to organize things or to indicate a selection.
6
+ * @documentation https://synergy.style/components/tag
7
+ * @status stable
8
+ * @since 2.0
9
+ *
10
+ * @dependency syn-icon-button
11
+ *
12
+ * @slot - The tag's content.
13
+ *
14
+ * @event syn-remove - Emitted when the remove button is activated.
15
+ *
16
+ * @csspart base - The component's base wrapper.
17
+ * @csspart content - The tag's content.
18
+ * @csspart remove-button - The tag's remove button, an `<syn-icon-button>`.
19
+ * @csspart remove-button__base - The remove button's exported `base` part.
20
+ */
21
+ export declare const SynTag: import("@lit/react").ReactWebComponent<Component, {
22
+ onSynRemove: EventName<SynRemoveEvent>;
23
+ }>;
24
+ export type { SynRemoveEvent } from '@synergy-design-system/components';
@@ -0,0 +1,7 @@
1
+ import {
2
+ SynTag
3
+ } from "../chunks/chunk.7T7PO2AE.js";
4
+ export {
5
+ SynTag
6
+ };
7
+ //# sourceMappingURL=tag.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/dist/index.d.ts CHANGED
@@ -2,9 +2,11 @@ export { SynButton } from './components/button.js';
2
2
  export { SynButtonGroup } from './components/button-group.js';
3
3
  export { SynCheckbox } from './components/checkbox.js';
4
4
  export { SynIcon } from './components/icon.js';
5
+ export { SynIconButton } from './components/icon-button.js';
5
6
  export { SynInput } from './components/input.js';
6
7
  export { SynRadio } from './components/radio.js';
7
8
  export { SynRadioButton } from './components/radio-button.js';
8
9
  export { SynRadioGroup } from './components/radio-group.js';
9
10
  export { SynSwitch } from './components/switch.js';
11
+ export { SynTag } from './components/tag.js';
10
12
  export { SynTextarea } from './components/textarea.js';
package/dist/index.js CHANGED
@@ -1,9 +1,15 @@
1
+ import {
2
+ SynRadioGroup
3
+ } from "./chunks/chunk.UVFFLBXG.js";
1
4
  import {
2
5
  SynRadio
3
6
  } from "./chunks/chunk.AFCMSVBY.js";
4
7
  import {
5
8
  SynSwitch
6
9
  } from "./chunks/chunk.TOR523VV.js";
10
+ import {
11
+ SynTag
12
+ } from "./chunks/chunk.7T7PO2AE.js";
7
13
  import {
8
14
  SynTextarea
9
15
  } from "./chunks/chunk.4YY6TGIA.js";
@@ -16,6 +22,9 @@ import {
16
22
  import {
17
23
  SynCheckbox
18
24
  } from "./chunks/chunk.FYIBHAO4.js";
25
+ import {
26
+ SynIconButton
27
+ } from "./chunks/chunk.W4YO4ERO.js";
19
28
  import {
20
29
  SynIcon
21
30
  } from "./chunks/chunk.6CO3KAZG.js";
@@ -25,19 +34,18 @@ import {
25
34
  import {
26
35
  SynRadioButton
27
36
  } from "./chunks/chunk.QBD4EIK5.js";
28
- import {
29
- SynRadioGroup
30
- } from "./chunks/chunk.UVFFLBXG.js";
31
37
  export {
32
38
  SynButton,
33
39
  SynButtonGroup,
34
40
  SynCheckbox,
35
41
  SynIcon,
42
+ SynIconButton,
36
43
  SynInput,
37
44
  SynRadio,
38
45
  SynRadioButton,
39
46
  SynRadioGroup,
40
47
  SynSwitch,
48
+ SynTag,
41
49
  SynTextarea
42
50
  };
43
51
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "dependencies": {
7
7
  "@lit/react": "^1.0.0",
8
- "@synergy-design-system/components": "^1.0.2"
8
+ "@synergy-design-system/components": "^1.2.0"
9
9
  },
10
10
  "description": "React wrappers for the Synergy Design System",
11
11
  "exports": {
@@ -40,7 +40,7 @@
40
40
  "directory": "packages/react"
41
41
  },
42
42
  "type": "module",
43
- "version": "1.0.2",
43
+ "version": "1.2.0",
44
44
  "devDependencies": {
45
45
  "@types/react": "^18.2.31",
46
46
  "react": "^18.2.0"