smoothly 0.3.1 → 0.3.3

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.
Files changed (26) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/{smoothly-accordion_50.cjs.entry.js → smoothly-accordion_53.cjs.entry.js} +151 -68
  3. package/dist/cjs/smoothly.cjs.js +1 -1
  4. package/dist/collection/collection-manifest.json +2 -0
  5. package/dist/collection/components/display-demo/index.js +18 -1
  6. package/dist/collection/components/input-demo/index.js +80 -40
  7. package/dist/collection/components/radio-button/Selected.js +1 -0
  8. package/dist/collection/components/radio-button/index.js +104 -0
  9. package/dist/collection/components/radio-button/item/index.js +86 -0
  10. package/dist/collection/components/radio-button/item/style.css +85 -0
  11. package/dist/collection/components/radio-button/style.css +3 -0
  12. package/dist/custom-elements/index.d.ts +12 -0
  13. package/dist/custom-elements/index.js +108 -56
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm/{smoothly-accordion_50.entry.js → smoothly-accordion_53.entry.js} +149 -69
  16. package/dist/esm/smoothly.js +1 -1
  17. package/dist/smoothly/{p-b92b1eb7.entry.js → p-e82a3604.entry.js} +1 -1
  18. package/dist/smoothly/smoothly.esm.js +1 -1
  19. package/dist/types/components/radio-button/Selected.d.ts +5 -0
  20. package/dist/types/components/radio-button/index.d.ts +11 -0
  21. package/dist/types/components/radio-button/item/index.d.ts +10 -0
  22. package/dist/types/components.d.ts +47 -0
  23. package/package.json +1 -1
  24. package/dist/cjs/smoothly-svg.cjs.entry.js +0 -41
  25. package/dist/esm/smoothly-svg.entry.js +0 -37
  26. package/dist/smoothly/p-8aefcb54.entry.js +0 -1
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["smoothly-google-font.cjs",[[2,"smoothly-google-font",{"value":[1]}]]],["smoothly-radio-group.cjs",[[4,"smoothly-radio-group",{"orientation":[513]}]]],["smoothly-reorder.cjs",[[0,"smoothly-reorder"]]],["smoothly-svg.cjs",[[2,"smoothly-svg",{"url":[513],"size":[513],"color":[1]}]]],["smoothly-trigger-sink.cjs",[[6,"smoothly-trigger-sink",{"context":[16],"destination":[1],"filter":[1]},[[0,"trigger","TriggerListener"]]]]],["smoothly-trigger-source.cjs",[[6,"smoothly-trigger-source",{"listen":[1]}]]],["smoothly-accordion_50.cjs",[[0,"smoothly-app-demo",{"baseUrl":[1,"base-url"]}],[0,"smoothly-input-demo"],[2,"smoothly-select-demo",null,[[0,"selectionChanged","handleSelectionChanged"]]],[2,"smoothly-table-demo"],[0,"smoothly-display-demo"],[4,"smoothly-app",{"color":[1]}],[0,"smoothly-dialog-demo"],[2,"smoothly-icon-demo"],[6,"smoothly-button",{"color":[513],"expand":[513],"fill":[513],"disabled":[516],"type":[513],"link":[1],"download":[4]}],[4,"smoothly-room",{"label":[1],"icon":[1],"path":[1],"to":[1]}],[2,"smoothly-input-date-range",{"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"open":[1028],"showLabel":[516,"show-label"]},[[0,"startChanged","onStartChanged"],[0,"endChanged","onEndChanged"],[0,"dateRangeSet","onDateRangeSet"]]],[1,"smoothly-picker",{"disabled":[516],"readonly":[516],"maxMenuHeight":[1,"max-menu-height"],"maxHeight":[1,"max-height"],"emptyMenuLabel":[1025,"empty-menu-label"],"multiple":[516],"mutable":[4],"optionStyle":[8,"option-style"],"options":[1040],"labelSetting":[513,"label-setting"],"label":[513],"selections":[1040],"selectNoneName":[1025,"select-none-name"],"selectAllName":[1025,"select-all-name"],"selectionName":[1025,"selection-name"],"newOptionLabel":[1025,"new-option-label"],"valueValidator":[16],"isOpen":[32],"empty":[32]},[[0,"optionSelect","optionSelectHandler"],[0,"optionUnselect","optionSelectHandler"],[0,"optionAdd","optionAddHandler"],[0,"menuEmpty","emptyHandler"]]],[6,"smoothly-notifier",{"notices":[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]],[6,"smoothly-dialog",{"color":[513],"open":[1540],"closable":[516],"header":[513]},[[0,"trigger","TriggerListener"]]],[2,"smoothly-backtotop",{"opacity":[1],"bottom":[1],"right":[1],"visible":[32]}],[2,"smoothly-checkbox",{"selectAll":[4,"select-all"],"size":[1],"intermediate":[1540],"selected":[1540],"disabled":[1540],"t":[32]}],[6,"smoothly-submit",{"processing":[1540],"color":[513],"expand":[513],"fill":[513],"disabled":[516],"prevent":[4],"submit":[64]},[[0,"click","handleSubmit"]]],[6,"smoothly-table-expandable-cell",{"align":[1],"open":[1540]},[[0,"click","onClick"]]],[6,"smoothly-table-expandable-row",{"align":[1],"open":[1540]},[[0,"click","onClick"]]],[0,"smoothly-urlencoded",{"data":[1]}],[6,"smoothly-accordion",{"value":[1025]},[[0,"smoothlyOpen","handleOpenClose"],[0,"smoothlyClose","handleOpenClose"],[0,"smoothlyAccordionItemDidLoad","onAccordionItemDidLoad"],[0,"smoothlyAccordionItemDidUnload","onAccordionItemDidUnload"]]],[6,"smoothly-accordion-item",{"name":[1],"brand":[1],"open":[1540]}],[2,"smoothly-display",{"type":[1],"value":[8],"currency":[1],"country":[1],"format":[16]}],[2,"smoothly-frame",{"url":[1],"name":[1],"origin":[1],"send":[64]}],[6,"smoothly-popup",{"visible":[1540],"direction":[1537],"cssVariables":[32]}],[6,"smoothly-radio",{"name":[1],"value":[1],"checked":[1540],"tabIndex":[2,"tab-index"]}],[6,"smoothly-select",{"identifier":[1],"background":[513],"value":[1025]}],[2,"smoothly-skeleton",{"widths":[16],"width":[1025],"color":[1],"period":[2],"distance":[1],"align":[513]}],[6,"smoothly-table",null,[[0,"expansionLoad","handleEvents"],[0,"expansionOpen","handleEvents"]]],[6,"smoothly-table-cell"],[6,"smoothly-table-header",{"name":[1]}],[6,"smoothly-table-row",null,[[0,"expansionLoad","onExpansionLoad"],[0,"expansionOpen","onExpansionOpen"]]],[6,"smoothly-input-date",{"name":[513],"value":[1025],"open":[1028],"max":[1025],"min":[1025],"disabled":[1028]},[[0,"dateSet","dateSetHandler"]]],[1,"smoothly-menu-options",{"toggle":[4],"emptyMenuLabel":[1025,"empty-menu-label"],"newOptionLabel":[1,"new-option-label"],"maxMenuHeight":[1,"max-menu-height"],"order":[4],"optionStyle":[8,"option-style"],"options":[1040],"resetHighlightOnOptionsChange":[1028,"reset-highlight-on-options-change"],"mutable":[4],"filteredOptions":[32],"highlightIndex":[32],"keyword":[32],"moveHighlight":[64],"setHighlight":[64],"getHighlighted":[64],"filterOptions":[64]},[[0,"optionHover","optionHoverHandler"]]],[2,"smoothly-notification",{"notice":[16],"tick":[32]},[[0,"trigger","onTrigger"]]],[2,"smoothly-display-amount",{"amount":[8],"currency":[1],"toInteger":[4,"to-integer"]}],[2,"smoothly-display-date-time",{"datetime":[1]}],[2,"smoothly-spinner",{"active":[516],"size":[513]}],[6,"smoothly-tab",{"label":[1],"open":[1540]},[[0,"click","onClick"]]],[6,"smoothly-tab-switch",{"selectedElement":[32]},[[0,"expansionOpen","openChanged"]]],[0,"smoothly-tuple",{"tuple":[16]}],[1,"smoothly-option",{"aliases":[513],"dataHighlight":[1540,"data-highlight"],"name":[1537],"value":[1537],"divider":[1540],"checkbox":[4],"new":[4],"toggle":[4],"checked":[1028]}],[2,"smoothly-calendar",{"month":[1025],"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"doubleInput":[516,"double-input"],"firstSelected":[32]}],[6,"smoothly-input",{"name":[513],"value":[1032],"type":[513],"required":[1540],"minLength":[1026,"min-length"],"showLabel":[516,"show-label"],"maxLength":[1026,"max-length"],"autocomplete":[1028],"pattern":[1040],"placeholder":[1025],"disabled":[1028],"readonly":[1028],"currency":[513],"initialValue":[32],"getFormData":[64],"setKeepFocusOnReRender":[64],"setSelectionRange":[64]}],[2,"smoothly-input-month",{"value":[1025]}],[6,"smoothly-quiet",{"color":[1]}],[6,"smoothly-selector",{"opened":[32],"selectedElement":[32],"missing":[32],"filter":[32]},[[0,"click","onClick"],[0,"itemSelected","onItemSelected"],[0,"keydown","onKeyDown"]]],[6,"smoothly-item",{"value":[8],"selected":[1540],"filter":[64]},[[0,"click","onClick"]]],[6,"smoothly-trigger",{"color":[513],"expand":[513],"fill":[513],"disabled":[516],"type":[513],"name":[1],"value":[8]},[[0,"click","onClick"]]],[2,"smoothly-icon",{"color":[513],"fill":[513],"name":[1],"size":[513],"toolTip":[1,"tool-tip"],"document":[32]}]]]], options);
18
+ return index.bootstrapLazy([["smoothly-google-font.cjs",[[2,"smoothly-google-font",{"value":[1]}]]],["smoothly-radio-group.cjs",[[4,"smoothly-radio-group",{"orientation":[513]}]]],["smoothly-reorder.cjs",[[0,"smoothly-reorder"]]],["smoothly-trigger-sink.cjs",[[6,"smoothly-trigger-sink",{"context":[16],"destination":[1],"filter":[1]},[[0,"trigger","TriggerListener"]]]]],["smoothly-trigger-source.cjs",[[6,"smoothly-trigger-source",{"listen":[1]}]]],["smoothly-accordion_53.cjs",[[0,"smoothly-app-demo",{"baseUrl":[1,"base-url"]}],[0,"smoothly-input-demo"],[2,"smoothly-select-demo",null,[[0,"selectionChanged","handleSelectionChanged"]]],[0,"smoothly-display-demo"],[2,"smoothly-table-demo"],[4,"smoothly-app",{"color":[1]}],[0,"smoothly-dialog-demo"],[2,"smoothly-icon-demo"],[6,"smoothly-button",{"color":[513],"expand":[513],"fill":[513],"disabled":[516],"type":[513],"link":[1],"download":[4]}],[4,"smoothly-room",{"label":[1],"icon":[1],"path":[1],"to":[1]}],[2,"smoothly-input-date-range",{"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"open":[1028],"showLabel":[516,"show-label"]},[[0,"startChanged","onStartChanged"],[0,"endChanged","onEndChanged"],[0,"dateRangeSet","onDateRangeSet"]]],[1,"smoothly-picker",{"disabled":[516],"readonly":[516],"maxMenuHeight":[1,"max-menu-height"],"maxHeight":[1,"max-height"],"emptyMenuLabel":[1025,"empty-menu-label"],"multiple":[516],"mutable":[4],"optionStyle":[8,"option-style"],"options":[1040],"labelSetting":[513,"label-setting"],"label":[513],"selections":[1040],"selectNoneName":[1025,"select-none-name"],"selectAllName":[1025,"select-all-name"],"selectionName":[1025,"selection-name"],"newOptionLabel":[1025,"new-option-label"],"valueValidator":[16],"isOpen":[32],"empty":[32]},[[0,"optionSelect","optionSelectHandler"],[0,"optionUnselect","optionSelectHandler"],[0,"optionAdd","optionAddHandler"],[0,"menuEmpty","emptyHandler"]]],[6,"smoothly-notifier",{"notices":[32]},[[0,"notice","onNotice"],[0,"remove","onRemove"]]],[6,"smoothly-dialog",{"color":[513],"open":[1540],"closable":[516],"header":[513]},[[0,"trigger","TriggerListener"]]],[2,"smoothly-backtotop",{"opacity":[1],"bottom":[1],"right":[1],"visible":[32]}],[2,"smoothly-checkbox",{"selectAll":[4,"select-all"],"size":[1],"intermediate":[1540],"selected":[1540],"disabled":[1540],"t":[32]}],[6,"smoothly-radio-button-item",{"value":[8],"selected":[1540]}],[6,"smoothly-submit",{"processing":[1540],"color":[513],"expand":[513],"fill":[513],"disabled":[516],"prevent":[4],"submit":[64]},[[0,"click","handleSubmit"]]],[6,"smoothly-table-expandable-cell",{"align":[1],"open":[1540]},[[0,"click","onClick"]]],[6,"smoothly-table-expandable-row",{"align":[1],"open":[1540]},[[0,"click","onClick"]]],[0,"smoothly-urlencoded",{"data":[1]}],[6,"smoothly-accordion",{"value":[1025]},[[0,"smoothlyOpen","handleOpenClose"],[0,"smoothlyClose","handleOpenClose"],[0,"smoothlyAccordionItemDidLoad","onAccordionItemDidLoad"],[0,"smoothlyAccordionItemDidUnload","onAccordionItemDidUnload"]]],[6,"smoothly-accordion-item",{"name":[1],"brand":[1],"open":[1540]}],[2,"smoothly-display",{"type":[1],"value":[8],"currency":[1],"country":[1],"format":[16]}],[2,"smoothly-display-amount",{"amount":[8],"currency":[1],"toInteger":[4,"to-integer"]}],[2,"smoothly-display-date-time",{"datetime":[1]}],[2,"smoothly-frame",{"url":[1],"name":[1],"origin":[1],"send":[64]}],[6,"smoothly-popup",{"visible":[1540],"direction":[1537],"cssVariables":[32]}],[6,"smoothly-radio",{"name":[1],"value":[1],"checked":[1540],"tabIndex":[2,"tab-index"]}],[6,"smoothly-radio-button",{"value":[1032],"deselectable":[516],"decoration":[513]},[[2,"radioItemSelectInternal","radioSelectHandler"]]],[6,"smoothly-select",{"identifier":[1],"background":[513],"value":[1025]}],[2,"smoothly-skeleton",{"widths":[16],"width":[1025],"color":[1],"period":[2],"distance":[1],"align":[513]}],[2,"smoothly-svg",{"url":[513],"size":[513],"color":[1]}],[6,"smoothly-table",null,[[0,"expansionLoad","handleEvents"],[0,"expansionOpen","handleEvents"]]],[6,"smoothly-table-cell"],[6,"smoothly-table-header",{"name":[1]}],[6,"smoothly-table-row",null,[[0,"expansionLoad","onExpansionLoad"],[0,"expansionOpen","onExpansionOpen"]]],[6,"smoothly-input-date",{"name":[513],"value":[1025],"open":[1028],"max":[1025],"min":[1025],"disabled":[1028]},[[0,"dateSet","dateSetHandler"]]],[1,"smoothly-menu-options",{"toggle":[4],"emptyMenuLabel":[1025,"empty-menu-label"],"newOptionLabel":[1,"new-option-label"],"maxMenuHeight":[1,"max-menu-height"],"order":[4],"optionStyle":[8,"option-style"],"options":[1040],"resetHighlightOnOptionsChange":[1028,"reset-highlight-on-options-change"],"mutable":[4],"filteredOptions":[32],"highlightIndex":[32],"keyword":[32],"moveHighlight":[64],"setHighlight":[64],"getHighlighted":[64],"filterOptions":[64]},[[0,"optionHover","optionHoverHandler"]]],[2,"smoothly-notification",{"notice":[16],"tick":[32]},[[0,"trigger","onTrigger"]]],[6,"smoothly-tab",{"label":[1],"open":[1540]},[[0,"click","onClick"]]],[6,"smoothly-tab-switch",{"selectedElement":[32]},[[0,"expansionOpen","openChanged"]]],[0,"smoothly-tuple",{"tuple":[16]}],[1,"smoothly-option",{"aliases":[513],"dataHighlight":[1540,"data-highlight"],"name":[1537],"value":[1537],"divider":[1540],"checkbox":[4],"new":[4],"toggle":[4],"checked":[1028]}],[2,"smoothly-spinner",{"active":[516],"size":[513]}],[2,"smoothly-calendar",{"month":[1025],"value":[1025],"start":[1025],"end":[1025],"max":[1025],"min":[1025],"doubleInput":[516,"double-input"],"firstSelected":[32]}],[6,"smoothly-input",{"name":[513],"value":[1032],"type":[513],"required":[1540],"minLength":[1026,"min-length"],"showLabel":[516,"show-label"],"maxLength":[1026,"max-length"],"autocomplete":[1028],"pattern":[1040],"placeholder":[1025],"disabled":[1028],"readonly":[1028],"currency":[513],"initialValue":[32],"getFormData":[64],"setKeepFocusOnReRender":[64],"setSelectionRange":[64]}],[2,"smoothly-input-month",{"value":[1025]}],[6,"smoothly-quiet",{"color":[1]}],[6,"smoothly-selector",{"opened":[32],"selectedElement":[32],"missing":[32],"filter":[32]},[[0,"click","onClick"],[0,"itemSelected","onItemSelected"],[0,"keydown","onKeyDown"]]],[6,"smoothly-item",{"value":[8],"selected":[1540],"filter":[64]},[[0,"click","onClick"]]],[6,"smoothly-trigger",{"color":[513],"expand":[513],"fill":[513],"disabled":[516],"type":[513],"name":[1],"value":[8]},[[0,"click","onClick"]]],[2,"smoothly-icon",{"color":[513],"fill":[513],"name":[1],"size":[513],"toolTip":[1,"tool-tip"],"document":[32]}]]]], options);
19
19
  });
@@ -32,6 +32,8 @@
32
32
  "./components/popup/index.js",
33
33
  "./components/quiet/index.js",
34
34
  "./components/radio/index.js",
35
+ "./components/radio-button/index.js",
36
+ "./components/radio-button/item/index.js",
35
37
  "./components/radio-group/index.js",
36
38
  "./components/reorder/index.js",
37
39
  "./components/room/index.js",
@@ -70,6 +70,12 @@ export class SmoothlyDisplayDemo {
70
70
  h("smoothly-display", { type: "date-time", format: { year: "2-digit", month: "numeric", day: "numeric" }, value: "2022-07-07T00:00+02:00" })),
71
71
  h("dd", null,
72
72
  h("smoothly-display", { type: "date-time", format: { year: "2-digit", month: "numeric", day: "numeric", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZone: "+01:00" }, value: "2022-07-07T12:15Z" })),
73
+ h("dt", null, "Deprecated display date time"),
74
+ h("dd", null,
75
+ h("smoothly-display-date-time", { datetime: "2019-01-31T20:01:34" })),
76
+ h("dt", null, "Display amount"),
77
+ h("dd", null,
78
+ h("smoothly-display-amount", { currency: "SEK", amount: "1289.5" })),
73
79
  h("dt", null, "Quiet"),
74
80
  h("dd", null,
75
81
  h("smoothly-quiet", { color: "dark" }, "-"))),
@@ -98,7 +104,18 @@ export class SmoothlyDisplayDemo {
98
104
  h("button", { onClick: () => this.noticeWarning(Notice.succeded("This is a test success notice.")) }, "success"),
99
105
  h("button", { onClick: () => this.noticeWarning(Notice.failed("This is a test danger notice.")) }, "danger"),
100
106
  h("button", { onClick: () => this.noticeWarning(Notice.execute("This is a test execute notice.", () => new Promise(resolve => window.setTimeout(() => resolve([true, "This went great"]), 3000)))) }, "execute"),
101
- h("button", { onClick: () => this.noticeWarning(Notice.delay("This is a test delay notice.", () => new Promise(resolve => window.setTimeout(() => resolve([true, "This went great"]), 3000)))) }, "delay")),
107
+ h("button", { onClick: () => this.noticeWarning(Notice.delay("This is a test delay notice.", () => new Promise(resolve => window.setTimeout(() => resolve([true, "This went great"]), 3000)))) }, "delay"),
108
+ h("div", { style: { position: "relative", height: "10em" } },
109
+ "Large Spinner",
110
+ h("smoothly-spinner", { active: true, size: "large", style: { "--background-color": "255,255,255", "--background-opacity": "0.2", "--spinner-color": "0,130,0", } })),
111
+ h("div", { style: { position: "relative", height: "10em" } },
112
+ "Medium Spinner",
113
+ h("smoothly-spinner", { active: true, size: "medium" })),
114
+ h("div", { style: { position: "relative", height: "10em" } },
115
+ "Small Spinner",
116
+ h("smoothly-spinner", { active: true, size: "small" })),
117
+ h("div", { style: { position: "absolute", left: "500px", top: "150px" } },
118
+ h("smoothly-svg", { url: "https://theme.payfunc.com/intergiro/animated-logo.svg" }))),
102
119
  ];
103
120
  }
104
121
  static get is() { return "smoothly-display-demo"; }
@@ -4,47 +4,87 @@ export class SmoothlyInputDemo {
4
4
  return [
5
5
  h("form", { action: "done", style: { position: "relative" } },
6
6
  h("header", null,
7
- h("h5", null, "Address")),
7
+ h("h5", null, "Form")),
8
8
  h("main", null,
9
- h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"),
10
- h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"),
11
- h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"),
12
- h("smoothly-input-date", null),
13
- h("smoothly-input", { type: "date", name: "date" }, "Date"),
14
- h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"),
15
- h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"),
16
- h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"),
17
- h("smoothly-input", { type: "card-number", name: "card" }, "Card #"),
18
- h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"),
19
- h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"),
20
- h("smoothly-radio", { name: "option", value: "1" }, "option 1"),
21
- h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"),
22
- h("smoothly-radio", { name: "option", value: "3" }, "option 3"),
23
- h("smoothly-accordion", null,
24
- h("smoothly-accordion-item", { name: "A", open: true },
25
- h("smoothly-radio", { name: "a", value: "1" }, "a 1"),
26
- h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"),
27
- h("smoothly-radio", { name: "a", value: "3" }, "a 3")),
28
- h("smoothly-accordion-item", { name: "B" },
29
- h("smoothly-radio", { name: "b", value: "1" }, "b 1"),
30
- h("smoothly-radio", { name: "b", value: "2" }, "b 2"),
31
- h("smoothly-radio", { name: "b", value: "3" }, "b 3"))),
32
- h("smoothly-display-amount", { currency: "SEK", amount: "1289.5" }),
33
- h("smoothly-display-date-time", { datetime: "2019-01-31T20:01:34" }),
34
- h("smoothly-checkbox", { selectAll: true, intermediate: true }),
35
- h("smoothly-checkbox", null),
36
- h("smoothly-checkbox", { disabled: true }),
37
- h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }),
38
- h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }),
39
- h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }),
40
- h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"),
41
- h("smoothly-input", { type: "text", name: "testing" }, "Texttest"),
42
- h("smoothly-input", { type: "password", name: "password" }, "Password"),
43
- h("smoothly-input", { type: "email", name: "email" }, "Email"),
44
- h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"),
45
- h("smoothly-input", { type: "percent", name: "percent" }, "Percent"),
46
- h("smoothly-input", { type: "phone", name: "phone" }, "Phone"),
47
- h("smoothly-input-date", null, "Date")),
9
+ h("fieldset", null,
10
+ h("h2", null, "Smoothly Iput"),
11
+ h("h3", null, "Card"),
12
+ h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"),
13
+ h("smoothly-input", { type: "text", name: "name.last", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"),
14
+ h("smoothly-input", { type: "text", name: "name.first", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"),
15
+ h("smoothly-input-date", null),
16
+ h("smoothly-input", { type: "date", name: "date" }, "Date"),
17
+ h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"),
18
+ h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"),
19
+ h("smoothly-input", { type: "text", name: "street", value: "street" }, "Street"),
20
+ h("smoothly-input", { type: "card-number", name: "card" }, "Card #"),
21
+ h("smoothly-input", { type: "card-expires", name: "card", style: { width: "calc(60% - 2px)" } }, "Expires"),
22
+ h("smoothly-input", { type: "card-csc", name: "card", style: { width: "calc(40% - 1px)", borderLeft: "none" } }, "CVV/CVC"),
23
+ h("h3", null, "Contact"),
24
+ h("smoothly-input", { type: "postal-code", name: "zip", style: { width: "calc(60% - 2px)" } }, "ZipCode"),
25
+ h("smoothly-input", { type: "text", name: "testing" }, "Texttest"),
26
+ h("smoothly-input", { type: "password", name: "password" }, "Password"),
27
+ h("smoothly-input", { type: "email", name: "email" }, "Email"),
28
+ h("smoothly-input", { type: "price", currency: "SEK", name: "price" }, "Price"),
29
+ h("smoothly-input", { type: "percent", name: "percent" }, "Percent"),
30
+ h("smoothly-input", { type: "phone", name: "phone" }, "Phone"),
31
+ h("smoothly-input-date", null, "Date")),
32
+ h("fieldset", null,
33
+ h("h2", null, "Smoothly Radio"),
34
+ h("h3", null, "Deselectable Radio List with button"),
35
+ h("smoothly-radio-button", { deselectable: true, decoration: "button" },
36
+ h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" } },
37
+ h("span", null, "Option 1"),
38
+ h("span", { slot: "expansion" }, "Some description.")),
39
+ h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } },
40
+ h("span", null, "Option 2"),
41
+ h("span", { slot: "expansion" }, "Some other description.")),
42
+ h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } },
43
+ h("span", null, "Option 3"))),
44
+ h("h3", null, "Radio List with button"),
45
+ h("smoothly-radio-button", { decoration: "button" },
46
+ h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" } },
47
+ h("span", null, "Option 1"),
48
+ h("span", { slot: "expansion" }, "Some description.")),
49
+ h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } },
50
+ h("span", null, "Option 2"),
51
+ h("span", { slot: "expansion" }, "Some other description.")),
52
+ h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } },
53
+ h("span", null, "Option 3"))),
54
+ h("h3", null, "Radio List without button"),
55
+ h("smoothly-radio-button", null,
56
+ h("smoothly-radio-button-item", { value: { some: "content", yes: "sir" } },
57
+ h("span", null, "Option 1"),
58
+ h("span", { slot: "expansion" }, "Some description.")),
59
+ h("smoothly-radio-button-item", { value: { some: "thing", yes: "miss" } },
60
+ h("span", null, "Option 2"),
61
+ h("span", { slot: "expansion" }, "Some other description.")),
62
+ h("smoothly-radio-button-item", { value: { some: "one", yes: "kid" } },
63
+ h("span", null, "Option 3"))),
64
+ h("smoothly-radio", { name: "option", value: "1" }, "option 1"),
65
+ h("smoothly-radio", { name: "option", value: "2", checked: true }, "option 2"),
66
+ h("smoothly-radio", { name: "option", value: "3" }, "option 3")),
67
+ h("fieldset", null,
68
+ h("h2", null, "Smoothly Accordion"),
69
+ h("smoothly-accordion", null,
70
+ h("smoothly-accordion-item", { name: "A", open: true },
71
+ h("smoothly-radio", { name: "a", value: "1" }, "a 1"),
72
+ h("smoothly-radio", { name: "a", value: "2", checked: true }, "a 2"),
73
+ h("smoothly-radio", { name: "a", value: "3" }, "a 3")),
74
+ h("smoothly-accordion-item", { name: "B" },
75
+ h("smoothly-radio", { name: "b", value: "1" }, "b 1"),
76
+ h("smoothly-radio", { name: "b", value: "2" }, "b 2"),
77
+ h("smoothly-radio", { name: "b", value: "3" }, "b 3")))),
78
+ h("fieldset", null,
79
+ h("h2", null, "Smoothly checkbox"),
80
+ h("smoothly-checkbox", { selectAll: true, intermediate: true }),
81
+ h("smoothly-checkbox", null),
82
+ h("smoothly-checkbox", { disabled: true })),
83
+ h("fieldset", null,
84
+ h("h2", null, "Smoothly addresses"),
85
+ h("smoothly-address-display", { value: '{ "countryCode": "SE", "street": "Korkstigen 2", "zipCode": "654 31", "city": "Fejksala" }' }),
86
+ h("smoothly-address", { editable: false, value: '{ "countryCode": "SE", "street": "Stigv\u00E4gen 34", "zipCode": "123 45", "city": "Hobbiton" }' }),
87
+ h("smoothly-addresses", { allowed: "billing delivery visit", editable: true, value: '{ "billing": { "countryCode": "SE", "street": "Rundslingan 3", "zipCode": "987 65", "city": "Klotby" }, "visit": { "countryCode": "SE", "street": "G\u00E5ngbanan 34", "zipCode": "543 21", "city": "Trasktr\u00E4sk" } }' }))),
48
88
  h("footer", null,
49
89
  h("smoothly-submit", { expand: "block", onSubmit: (e) => alert(e), color: "success" }, "Submit"),
50
90
  h("smoothly-trigger", { expand: "block", color: "success", onClick: (e) => console.log(e.detail) }, "Trigger"))),
@@ -0,0 +1,104 @@
1
+ import { Component, Event, h, Host, Listen, Prop } from "@stencil/core";
2
+ export class SmoothlyRadioButton {
3
+ constructor() {
4
+ this.decoration = "radio";
5
+ }
6
+ radioSelectHandler(event) {
7
+ var _a, _b;
8
+ if (this.deselectable || ((_a = this.active) === null || _a === void 0 ? void 0 : _a.value) != event.detail.value) {
9
+ (_b = this.active) === null || _b === void 0 ? void 0 : _b.select(false);
10
+ this.active = event.detail;
11
+ this.radioButtonSelected.emit((this.value = this.active.selected ? event.detail.value : undefined));
12
+ this.active.select(this.active.selected);
13
+ }
14
+ }
15
+ render() {
16
+ return (h(Host, null,
17
+ h("slot", null)));
18
+ }
19
+ static get is() { return "smoothly-radio-button"; }
20
+ static get encapsulation() { return "scoped"; }
21
+ static get originalStyleUrls() { return {
22
+ "$": ["style.css"]
23
+ }; }
24
+ static get styleUrls() { return {
25
+ "$": ["style.css"]
26
+ }; }
27
+ static get properties() { return {
28
+ "value": {
29
+ "type": "any",
30
+ "mutable": true,
31
+ "complexType": {
32
+ "original": "any",
33
+ "resolved": "any",
34
+ "references": {}
35
+ },
36
+ "required": false,
37
+ "optional": true,
38
+ "docs": {
39
+ "tags": [],
40
+ "text": ""
41
+ },
42
+ "attribute": "value",
43
+ "reflect": false
44
+ },
45
+ "deselectable": {
46
+ "type": "boolean",
47
+ "mutable": false,
48
+ "complexType": {
49
+ "original": "boolean",
50
+ "resolved": "boolean | undefined",
51
+ "references": {}
52
+ },
53
+ "required": false,
54
+ "optional": true,
55
+ "docs": {
56
+ "tags": [],
57
+ "text": ""
58
+ },
59
+ "attribute": "deselectable",
60
+ "reflect": true
61
+ },
62
+ "decoration": {
63
+ "type": "string",
64
+ "mutable": false,
65
+ "complexType": {
66
+ "original": "\"button\" | \"radio\"",
67
+ "resolved": "\"button\" | \"radio\"",
68
+ "references": {}
69
+ },
70
+ "required": false,
71
+ "optional": false,
72
+ "docs": {
73
+ "tags": [],
74
+ "text": ""
75
+ },
76
+ "attribute": "decoration",
77
+ "reflect": true,
78
+ "defaultValue": "\"radio\""
79
+ }
80
+ }; }
81
+ static get events() { return [{
82
+ "method": "radioButtonSelected",
83
+ "name": "radioButtonSelected",
84
+ "bubbles": true,
85
+ "cancelable": true,
86
+ "composed": true,
87
+ "docs": {
88
+ "tags": [],
89
+ "text": ""
90
+ },
91
+ "complexType": {
92
+ "original": "any",
93
+ "resolved": "any",
94
+ "references": {}
95
+ }
96
+ }]; }
97
+ static get listeners() { return [{
98
+ "name": "radioItemSelectInternal",
99
+ "method": "radioSelectHandler",
100
+ "target": undefined,
101
+ "capture": true,
102
+ "passive": false
103
+ }]; }
104
+ }
@@ -0,0 +1,86 @@
1
+ import { Component, Event, h, Host, Prop } from "@stencil/core";
2
+ export class SmoothlyRadioButtonItem {
3
+ componentWillLoad() {
4
+ this.select(this.selected);
5
+ }
6
+ select(selected = false) {
7
+ this.radioItemSelectInternal.emit({
8
+ value: this.value,
9
+ selected,
10
+ select: s => (this.selected = s),
11
+ });
12
+ }
13
+ render() {
14
+ return (h(Host, null,
15
+ h("header", { onClick: () => this.select(!this.selected) },
16
+ h("smoothly-icon", { color: this.selected ? "success" : "medium", fill: "solid", name: this.selected ? "checkmark-circle" : "ellipse-outline", size: "tiny", toolTip: "Select" }),
17
+ h("slot", null),
18
+ h("slot", { name: "end" })),
19
+ h("slot", { name: "expansion" })));
20
+ }
21
+ static get is() { return "smoothly-radio-button-item"; }
22
+ static get encapsulation() { return "scoped"; }
23
+ static get originalStyleUrls() { return {
24
+ "$": ["style.css"]
25
+ }; }
26
+ static get styleUrls() { return {
27
+ "$": ["style.css"]
28
+ }; }
29
+ static get properties() { return {
30
+ "value": {
31
+ "type": "any",
32
+ "mutable": false,
33
+ "complexType": {
34
+ "original": "any",
35
+ "resolved": "any",
36
+ "references": {}
37
+ },
38
+ "required": false,
39
+ "optional": false,
40
+ "docs": {
41
+ "tags": [],
42
+ "text": ""
43
+ },
44
+ "attribute": "value",
45
+ "reflect": false
46
+ },
47
+ "selected": {
48
+ "type": "boolean",
49
+ "mutable": true,
50
+ "complexType": {
51
+ "original": "boolean",
52
+ "resolved": "boolean",
53
+ "references": {}
54
+ },
55
+ "required": false,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": ""
60
+ },
61
+ "attribute": "selected",
62
+ "reflect": true
63
+ }
64
+ }; }
65
+ static get events() { return [{
66
+ "method": "radioItemSelectInternal",
67
+ "name": "radioItemSelectInternal",
68
+ "bubbles": true,
69
+ "cancelable": true,
70
+ "composed": true,
71
+ "docs": {
72
+ "tags": [],
73
+ "text": ""
74
+ },
75
+ "complexType": {
76
+ "original": "Selected",
77
+ "resolved": "Selected",
78
+ "references": {
79
+ "Selected": {
80
+ "location": "import",
81
+ "path": "../Selected"
82
+ }
83
+ }
84
+ }
85
+ }]; }
86
+ }
@@ -0,0 +1,85 @@
1
+ smoothly-radio-button[decoration=radio] :host > header {
2
+ padding: 0.5rem;
3
+ }
4
+
5
+ smoothly-radio-button[decoration=radio] :host > header > smoothly-icon {
6
+ display: none;
7
+ }
8
+ smoothly-radio-button[decoration=radio] :host[selected] > header {
9
+ color: rgb(var(--smoothly-primary-contrast));
10
+ background: rgb(var(--smoothly-primary-color));
11
+ }
12
+
13
+ smoothly-radio-button[decoration=radio] ::slotted([slot=expansion])::before {
14
+ content: unset;
15
+ }
16
+
17
+ smoothly-radio-button[decoration=button] :host > header > smoothly-icon {
18
+ margin-right: 0.5rem;
19
+ border-radius: 100%;
20
+ font-size: 1.3rem;
21
+ display: flex;
22
+ background: rgb(var(--smoothly-light-color));
23
+ transition: 0.2s;
24
+ }
25
+
26
+ smoothly-radio-button[decoration=button] :host[selected] > header > smoothly-icon {
27
+ color: rgb(var(--smoothly-success-color));
28
+ background: rgb(var(--smoothly-success-shade));
29
+ }
30
+
31
+ smoothly-radio-button[decoration=button] ::slotted([slot=expansion]) {
32
+ background: rgb(var(--smoothly-primary-color));
33
+ color: rgb(var(--smoothly-primary-contrast));
34
+ border-radius: 5px;
35
+ margin-top: 0.5rem;
36
+ }
37
+
38
+ smoothly-radio-button[decoration=button] ::slotted([slot=expansion])::before {
39
+ content: "\25B2";
40
+ position: absolute;
41
+ top: -0.8rem;
42
+ left: 3rem;
43
+ color: rgb(var(--smoothly-primary-color));
44
+ }
45
+
46
+ @media screen and (min-width: 900px){
47
+ smoothly-radio-button[decoration=button] :host > header:hover > smoothly-icon {
48
+ background: rgb(var(--smoothly-success-color));
49
+ cursor: pointer;
50
+ }
51
+ smoothly-radio-button[deselectable] :host[selected] > header:hover > smoothly-icon {
52
+ background: rgb(var(--smoothly-warning-shade));
53
+ color: rgb(var(--smoothly-warning-color));
54
+ cursor: pointer;
55
+ }
56
+ }
57
+
58
+
59
+ :host {
60
+ display: block;
61
+ margin-bottom: 0.5rem;
62
+ }
63
+
64
+ :host:last-child {
65
+ margin-bottom: 0;
66
+ }
67
+
68
+ :host > header {
69
+ display: flex;
70
+ align-items: center;
71
+ }
72
+
73
+ ::slotted([slot=expansion]) {
74
+ display: none;
75
+ background: rgb(var(--smoothly-primary-tint));
76
+ color: rgb(var(--smoothly-primary-contrast));
77
+ padding: 0;
78
+ position: relative;
79
+ transition: 0.1s;
80
+ }
81
+
82
+ [selected]::slotted([slot=expansion]) {
83
+ display: block;
84
+ padding: 0.5rem;
85
+ }
@@ -0,0 +1,3 @@
1
+ :host {
2
+ display: block;
3
+ }
@@ -194,6 +194,18 @@ export const SmoothlyRadio: {
194
194
  new (): SmoothlyRadio;
195
195
  };
196
196
 
197
+ interface SmoothlyRadioButton extends Components.SmoothlyRadioButton, HTMLElement {}
198
+ export const SmoothlyRadioButton: {
199
+ prototype: SmoothlyRadioButton;
200
+ new (): SmoothlyRadioButton;
201
+ };
202
+
203
+ interface SmoothlyRadioButtonItem extends Components.SmoothlyRadioButtonItem, HTMLElement {}
204
+ export const SmoothlyRadioButtonItem: {
205
+ prototype: SmoothlyRadioButtonItem;
206
+ new (): SmoothlyRadioButtonItem;
207
+ };
208
+
197
209
  interface SmoothlyRadioGroup extends Components.SmoothlyRadioGroup, HTMLElement {}
198
210
  export const SmoothlyRadioGroup: {
199
211
  prototype: SmoothlyRadioGroup;