@supersoniks/concorde 3.1.48 → 3.1.49

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 (147) hide show
  1. package/build-infos.json +1 -1
  2. package/concorde-core.bundle.js +103 -103
  3. package/concorde-core.es.js +621 -611
  4. package/dist/concorde-core.bundle.js +103 -103
  5. package/dist/concorde-core.es.js +621 -611
  6. package/docs/assets/index-CcoMn1RV.js +4465 -0
  7. package/docs/assets/index-D0m8hkmQ.css +1 -0
  8. package/docs/css/docs.css +0 -0
  9. package/docs/fonts/ClashGrotesk-Bold.eot +0 -0
  10. package/docs/fonts/ClashGrotesk-Bold.ttf +0 -0
  11. package/docs/fonts/ClashGrotesk-Bold.woff +0 -0
  12. package/docs/fonts/ClashGrotesk-Bold.woff2 +0 -0
  13. package/docs/fonts/ClashGrotesk-Extralight.eot +0 -0
  14. package/docs/fonts/ClashGrotesk-Extralight.ttf +0 -0
  15. package/docs/fonts/ClashGrotesk-Extralight.woff +0 -0
  16. package/docs/fonts/ClashGrotesk-Extralight.woff2 +0 -0
  17. package/docs/fonts/ClashGrotesk-Light.eot +0 -0
  18. package/docs/fonts/ClashGrotesk-Light.ttf +0 -0
  19. package/docs/fonts/ClashGrotesk-Light.woff +0 -0
  20. package/docs/fonts/ClashGrotesk-Light.woff2 +0 -0
  21. package/docs/fonts/ClashGrotesk-Medium.eot +0 -0
  22. package/docs/fonts/ClashGrotesk-Medium.ttf +0 -0
  23. package/docs/fonts/ClashGrotesk-Medium.woff +0 -0
  24. package/docs/fonts/ClashGrotesk-Medium.woff2 +0 -0
  25. package/docs/fonts/ClashGrotesk-Regular.eot +0 -0
  26. package/docs/fonts/ClashGrotesk-Regular.ttf +0 -0
  27. package/docs/fonts/ClashGrotesk-Regular.woff +0 -0
  28. package/docs/fonts/ClashGrotesk-Regular.woff2 +0 -0
  29. package/docs/fonts/ClashGrotesk-Semibold.eot +0 -0
  30. package/docs/fonts/ClashGrotesk-Semibold.ttf +0 -0
  31. package/docs/fonts/ClashGrotesk-Semibold.woff +0 -0
  32. package/docs/fonts/ClashGrotesk-Semibold.woff2 +0 -0
  33. package/docs/fonts/ClashGrotesk-Variable.eot +0 -0
  34. package/docs/fonts/ClashGrotesk-Variable.ttf +0 -0
  35. package/docs/fonts/ClashGrotesk-Variable.woff +0 -0
  36. package/docs/fonts/ClashGrotesk-Variable.woff2 +0 -0
  37. package/docs/img/concorde-icon.svg +5 -0
  38. package/docs/img/concorde-logo.svg +1 -0
  39. package/docs/img/concorde.png +0 -0
  40. package/docs/img/concorde_def.png +0 -0
  41. package/docs/img/concorde_seuil.png.webp +0 -0
  42. package/docs/img/concorde_seuil_invert.png +0 -0
  43. package/docs/img/paul_metrand.jpg +0 -0
  44. package/docs/img/paul_metrand_xs.jpg +0 -0
  45. package/docs/index.html +93 -0
  46. package/docs/src/core/components/functional/date/date.md +290 -0
  47. package/docs/src/core/components/functional/fetch/fetch.md +117 -0
  48. package/docs/src/core/components/functional/if/if.md +16 -0
  49. package/docs/src/core/components/functional/list/list.md +199 -0
  50. package/docs/src/core/components/functional/mix/mix.md +41 -0
  51. package/docs/src/core/components/functional/queue/queue.md +87 -0
  52. package/docs/src/core/components/functional/router/router.md +108 -0
  53. package/docs/src/core/components/functional/sdui/default-library.json +108 -0
  54. package/docs/src/core/components/functional/sdui/example.json +99 -0
  55. package/docs/src/core/components/functional/sdui/sdui.md +356 -0
  56. package/docs/src/core/components/functional/states/states.md +87 -0
  57. package/docs/src/core/components/functional/submit/submit.md +83 -0
  58. package/docs/src/core/components/functional/subscriber/subscriber.md +91 -0
  59. package/docs/src/core/components/functional/value/value.md +35 -0
  60. package/docs/src/core/components/ui/alert/alert.md +121 -0
  61. package/docs/src/core/components/ui/badge/badge.md +127 -0
  62. package/docs/src/core/components/ui/button/button.md +184 -0
  63. package/docs/src/core/components/ui/captcha/captcha.md +12 -0
  64. package/docs/src/core/components/ui/card/card.md +97 -0
  65. package/docs/src/core/components/ui/divider/divider.md +35 -0
  66. package/docs/src/core/components/ui/form/checkbox/checkbox.md +94 -0
  67. package/docs/src/core/components/ui/form/fieldset/fieldset.md +129 -0
  68. package/docs/src/core/components/ui/form/form-actions/form-actions.md +77 -0
  69. package/docs/src/core/components/ui/form/form-layout/form-layout.md +43 -0
  70. package/docs/src/core/components/ui/form/input/input.md +167 -0
  71. package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +130 -0
  72. package/docs/src/core/components/ui/form/radio/radio.md +84 -0
  73. package/docs/src/core/components/ui/form/select/select.md +97 -0
  74. package/docs/src/core/components/ui/form/textarea/textarea.md +65 -0
  75. package/docs/src/core/components/ui/group/group.md +75 -0
  76. package/docs/src/core/components/ui/icon/icon.md +125 -0
  77. package/docs/src/core/components/ui/icon/icons.json +1 -0
  78. package/docs/src/core/components/ui/image/image.md +107 -0
  79. package/docs/src/core/components/ui/link/link.md +43 -0
  80. package/docs/src/core/components/ui/loader/loader.md +67 -0
  81. package/docs/src/core/components/ui/menu/menu.md +288 -0
  82. package/docs/src/core/components/ui/modal/modal.md +123 -0
  83. package/docs/src/core/components/ui/pop/pop.md +79 -0
  84. package/docs/src/core/components/ui/progress/progress.md +63 -0
  85. package/docs/src/core/components/ui/table/table.md +455 -0
  86. package/docs/src/core/components/ui/tooltip/tooltip.md +82 -0
  87. package/docs/src/docs/_core-concept/overview.md +57 -0
  88. package/docs/src/docs/_core-concept/subscriber.md +76 -0
  89. package/docs/src/docs/_getting-started/concorde-outside.md +143 -0
  90. package/docs/src/docs/_getting-started/create-a-component.md +137 -0
  91. package/docs/src/docs/_getting-started/my-first-subscriber.md +174 -0
  92. package/docs/src/docs/_getting-started/pubsub.md +150 -0
  93. package/docs/src/docs/_getting-started/start.md +39 -0
  94. package/docs/src/docs/_getting-started/theming.md +91 -0
  95. package/docs/src/docs/search/docs-search.json +3887 -0
  96. package/docs/src/tag-list.json +1 -0
  97. package/docs/src/tsconfig-model.json +23 -0
  98. package/docs/src/tsconfig.json +826 -0
  99. package/docs/svg/regular/plane.svg +1 -0
  100. package/docs/svg/solid/plane.svg +1 -0
  101. package/index.html +0 -0
  102. package/package.json +1 -1
  103. package/scripts/pre-build.mjs +0 -0
  104. package/scripts/pre-publish.mjs +0 -0
  105. package/src/core/_types/types.ts +1 -1
  106. package/src/core/components/functional/queue/queue.ts +0 -0
  107. package/src/core/components/functional/router/router.md +0 -0
  108. package/src/core/components/functional/router/router.ts +0 -0
  109. package/src/core/components/functional/sonic-scope/sonic-scope.ts +0 -0
  110. package/src/core/components/functional/states/states.md +0 -0
  111. package/src/core/components/functional/states/states.ts +0 -0
  112. package/src/core/components/functional/submit/submit.md +0 -0
  113. package/src/core/components/functional/submit/submit.ts +0 -0
  114. package/src/core/components/ui/alert/alert.md +0 -0
  115. package/src/core/components/ui/alert-messages/alert-messages.ts +0 -0
  116. package/src/core/components/ui/badge/badge.md +0 -0
  117. package/src/core/components/ui/captcha/captcha.ts +9 -4
  118. package/src/core/components/ui/form/checkbox/checkbox.md +0 -0
  119. package/src/core/components/ui/form/fieldset/fieldset.ts +0 -0
  120. package/src/core/components/ui/form/input/password-helper.ts +0 -0
  121. package/src/core/components/ui/form/input/same-value-helper.ts +0 -0
  122. package/src/core/components/ui/form/radio/radio.md +0 -0
  123. package/src/core/components/ui/form/select/select.md +0 -0
  124. package/src/core/components/ui/group/group.ts +0 -0
  125. package/src/core/components/ui/icon/icons.ts +37 -16
  126. package/src/core/components/ui/image/image.ts +0 -0
  127. package/src/core/components/ui/menu/menu.ts +0 -0
  128. package/src/core/components/ui/modal/modal.md +0 -0
  129. package/src/core/components/ui/theme/theme-collection/dark.ts +0 -0
  130. package/src/core/components/ui/toast/message-subscriber.ts +0 -0
  131. package/src/core/components/ui/toast/toast.ts +0 -0
  132. package/src/core/components/ui/ui.ts +0 -0
  133. package/src/core/core.ts +0 -0
  134. package/src/core/mixins/FormCheckable.ts +0 -0
  135. package/src/core/mixins/Subscriber.ts +0 -0
  136. package/src/core/utils/HTML.ts +0 -0
  137. package/src/core/utils/LocationHandler.ts +0 -0
  138. package/src/core/utils/Objects.ts +0 -0
  139. package/src/core/utils/PublisherProxy.ts +0 -0
  140. package/src/core/utils/Utils.ts +0 -0
  141. package/src/core/utils/route.ts +0 -0
  142. package/src/docs/docs.ts +0 -0
  143. package/src/docs/search/docs-search.json +0 -0
  144. package/src/docs/search/page.ts +0 -0
  145. package/src/docs/search/search.ts +10 -6
  146. package/src/tsconfig-model.json +0 -0
  147. package/vite/config.js +0 -0
@@ -0,0 +1,83 @@
1
+ # Submit
2
+
3
+ ## The submit element is used to send data to a rest service
4
+ * The api is set up like a [fetcher](#core/components/functional/fetch/fetch.md/fetch).
5
+ * The *formDataProvider* attribute points to the adress where the data is held by a publisher.
6
+ * This attribute is also used by form elements such as *sonic-input*, or *sonic-select*, which fill this publisher with their *value* attribute according to their *name* attribute
7
+ * The *method* attribute allows you to choose the sending method: *put/delete/post*, *post* being the default method.
8
+ * If the *onClick* attribute is present, the data is sent when the content is clicked on
9
+ * If the *onEnterKey* attribute is present, data is sent when the enter key of an element contained in the *sonic-submit* with focus is pressed
10
+ * During sending, *sonic-submit* elements with the same *dataProvider* attribute have the *disabled="disabled "* property, which has the effect of disabling their content
11
+ * The *clearedDataOnSuccess* attribute can be used to clear the data from the corresponding dataProvider when the call to the api has provided a result.
12
+
13
+ ## Form example
14
+ <sonic-code>
15
+ <template>
16
+ <sonic-scope
17
+ serviceURL="https://reqres.in" dataProvider="api/register"
18
+ formDataProvider="submit-example" submitResultDataProvider="submit-example-result"
19
+ method="post"
20
+ class="max-w-lg block"
21
+ >
22
+ <sonic-submit onEnterKey>
23
+ <div class="grid grid-cols-2 gap-4 mb-4 ">
24
+ <sonic-input required name="email" type="email" value="eve.holt@reqres.in"></sonic-input>
25
+ <sonic-input required type="password" name="password" value="pistol"></sonic-input>
26
+ </div>
27
+ </sonic-submit>
28
+ <sonic-submit onClick>
29
+ <sonic-button type="success" class="w-full">Submit</sonic-button>
30
+ </sonic-submit>
31
+ </sonic-scope>
32
+ </template>
33
+ </sonic-code>
34
+
35
+
36
+
37
+
38
+
39
+ ## Result handling example
40
+
41
+ Result will show when something has been submit because the **dataprovider** used in this example is the same as the **submitResultDataProvider** used in the previous form.
42
+ <sonic-code>
43
+ <template>
44
+ <div dataProvider="submit-example-result">
45
+ <div>Id : <span data-bind ::inner-html="$id"></span></div>
46
+ <div>Token : <span data-bind ::inner-html="$token"></span></div>
47
+ <div data-bind ::inner-html="$error"></div>
48
+ </div>
49
+ </template>
50
+ </sonic-code>
51
+
52
+
53
+ ## dot notation
54
+
55
+ You can write the folowing code where the name attribute is written in dot notation.
56
+
57
+ <sonic-code>
58
+ <template>
59
+ <sonic-scope formDataProvider="submit-example-dot-notation">
60
+ <div class="grid grid-cols-2 gap-4 mb-4 ">
61
+ <sonic-input required name="email.value" type="email" value="eve.holt@reqres.in"></sonic-input>
62
+ <sonic-input required type="password" name="details.password.value" value="pistol"></sonic-input>
63
+ </div>
64
+ </sonic-scope>
65
+ </template>
66
+ </sonic-code>
67
+
68
+ The data will be stored in the following format:
69
+
70
+ <sonic-code language="typescript">
71
+ <template>
72
+ {
73
+ email: {
74
+ value: "eve.holt@reqres.in",
75
+ },
76
+ details: {
77
+ password: {
78
+ value: "pistol",
79
+ },
80
+ },
81
+ }
82
+ </template>
83
+ </sonic-code>
@@ -0,0 +1,91 @@
1
+ # Subscriber
2
+
3
+ La mixin Subscriber permet lier un composant à un publisher.
4
+ La liaison à un publisher se fait via l'attribut *dataProvider* du composant qui représente ce que l'on obtient en appellant PublisherManager.get(dataProvider).
5
+
6
+ Les propriétés du composant sont automatiquement remplies avec les propriétés du même nom dans les données du publisher.
7
+
8
+ Le composant est automatiquement mis à jour lorsque les données du publisher sont mises à jour.
9
+
10
+ ## DataProvider
11
+
12
+ **Id** of the dataProvider that the component will **subscribe** to
13
+
14
+ <sonic-code>
15
+ <template>
16
+ <sonic-subscriber dataProvider="id_that_the_subsriber_will_subscribe_to" debug>
17
+ <sonic-button> custom dataProvider id</sonic-button>
18
+ </sonic-subscriber>
19
+ <sonic-subscriber debug>
20
+ <sonic-button> default id : pageHTML</sonic-button>
21
+ </sonic-subscriber>
22
+ </template>
23
+ </sonic-code>
24
+
25
+ ## Props
26
+
27
+ Data object (json) that will be passed to the dataProvider
28
+
29
+ <sonic-code>
30
+ <template>
31
+ <sonic-subscriber props='{"data":"Hello world"}' debug>
32
+ <sonic-button> Hover to see the data</sonic-button>
33
+ </sonic-subscriber>
34
+ </template>
35
+ </sonic-code>
36
+
37
+
38
+ ## Debug
39
+
40
+ **Helper**, display the data held by the dataProvider in a floating div
41
+
42
+ <sonic-code>
43
+ <template>
44
+ <sonic-subscriber debug>
45
+ <sonic-button> see the dataProvider'data </sonic-button>
46
+ </sonic-subscriber>
47
+ </template>
48
+ </sonic-code>
49
+
50
+
51
+ ## NoAutofill
52
+
53
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
54
+
55
+ ## PropertyMap
56
+
57
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
58
+
59
+ Permet de mapper un nom de propriété de donnée source vers une propriété du subscriber à la volée
60
+
61
+ ## BindPublisher
62
+
63
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
64
+
65
+ On peut utiliser cette fonction pour lier un publisher spécifique au composant si besoin.
66
+
67
+ ## instanceCounter
68
+
69
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
70
+
71
+ ## Publisher
72
+
73
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
74
+
75
+ ## Args
76
+
77
+ <sonic-alert status="info">Docs coming soon</sonic-alert>
78
+
79
+ ## NoShadowDom
80
+
81
+ Par défaut on crée un shadow dom mais on peut demander à ne pas en avoir via cette propriété et un attribut associé.
82
+ Cela se fait à l'initialisation uniquement et n'est pas modifiable lors de la vie du composant.
83
+
84
+
85
+ ## Other attributes gathered from subscriber.stories.ts
86
+
87
+ styles ??
88
+ title ??
89
+ _props ??
90
+ onAssign ??
91
+ defferedDebug ??
@@ -0,0 +1,35 @@
1
+ # Value
2
+
3
+ Simply shows a value from a data provider.
4
+ You can target sub data value using dot syntax.
5
+ The value reacts to changes.
6
+
7
+ * Below is a form that helps you to set a value for the field "preference" in the data target with id "value-example"
8
+ <sonic-code>
9
+ <template>
10
+ <div formDataProvider="value-example">
11
+ which one do you prefer ?
12
+ <sonic-radio name="preference" checked value="dogs"> Dogs</sonic-radio>
13
+ <sonic-radio name="preference" value="cats"> Cats</sonic-radio>
14
+ </div>
15
+ </template>
16
+ </sonic-code>
17
+ * Then you can see live value of the preference using this code :
18
+ <sonic-code>
19
+ <template>
20
+ I prefer <sonic-value dataProvider="value-example" key="preference"></sonic-value>
21
+ </template>
22
+ </sonic-code>
23
+ * If you have more complex data like this
24
+ <sonic-code>
25
+ <template>
26
+ <sonic-subscriber dataProvider="value-example-2" props='{"my":{"complex":[{"data":"👋 Hi There"}]}}'></sonic-subscriber>
27
+ </template>
28
+ </sonic-code>
29
+ * You can target it with the dot syntax
30
+ <sonic-code>
31
+ <template>
32
+ <sonic-value dataProvider="value-example-2" key="my.complex.0.data"></sonic-value>
33
+ </template>
34
+ </sonic-code>
35
+
@@ -0,0 +1,121 @@
1
+ # Alert
2
+
3
+ <sonic-code>
4
+ <template>
5
+ <sonic-alert status="error" label="Email error" text="This address is already in use" background></sonic-alert>
6
+ </template>
7
+ </sonic-code>
8
+
9
+ ## Status
10
+
11
+ <sonic-code>
12
+ <template>
13
+ <div class="grid gap-4">
14
+ <sonic-alert label="Default"> This address is already in use. </sonic-alert>
15
+ <sonic-alert status="success" label="Success"> This address is already in use. </sonic-alert>
16
+ <sonic-alert status="error" label="Error"> This address is already in use. </sonic-alert>
17
+ <sonic-alert status="warning" label="Warning"> This address is already in use. </sonic-alert>
18
+ <sonic-alert status="info" label="Info"> This address is already in use. </sonic-alert>
19
+ </div>
20
+ </template>
21
+ </sonic-code>
22
+
23
+ ## Sizes
24
+
25
+ <sonic-code>
26
+ <template>
27
+ <div class="grid gap-4">
28
+ <sonic-alert status="error" label="Email error" size="2xs">
29
+ This address is already in use. Lorem ipsum dolor sit amet.
30
+ </sonic-alert>
31
+ <sonic-alert status="error" label="Email error" size="xs">
32
+ This address is already in use. Lorem ipsum dolor sit amet.
33
+ </sonic-alert>
34
+ <sonic-alert status="error" label="Email error" size="sm">
35
+ This address is already in use. Lorem ipsum dolor sit amet.
36
+ </sonic-alert>
37
+ <sonic-alert status="error" label="Email error">
38
+ This address is already in use. Lorem ipsum dolor sit amet.
39
+ </sonic-alert>
40
+ <sonic-alert status="error" label="Email error" size="lg">
41
+ This address is already in use. Lorem ipsum dolor sit amet.
42
+ </sonic-alert>
43
+ <sonic-alert status="error" label="Email error" size="xl">
44
+ This address is already in use. Lorem ipsum dolor sit amet.
45
+ </sonic-alert>
46
+ <sonic-alert status="error" label="Email error" size="2xl">
47
+ This address is already in use. Lorem ipsum dolor sit amet.
48
+ </sonic-alert>
49
+ </div>
50
+ </template>
51
+ </sonic-code>
52
+
53
+ ## Alert with link
54
+
55
+ <sonic-code>
56
+ <template>
57
+ <sonic-alert status="info" label="New messages !">
58
+ You have 2 unread messages<br />
59
+ <div class="flex gap-2 mt-1">
60
+ <sonic-button variant="outline" type="info" size="xs">See messages</sonic-button>
61
+ <sonic-button variant="ghost" type="info" size="xs">dismiss</sonic-button>
62
+ </div>
63
+ </sonic-alert>
64
+ </template>
65
+ </sonic-code>
66
+
67
+ ## Background
68
+
69
+ <sonic-code>
70
+ <template>
71
+ <div class="grid gap-4">
72
+ <sonic-alert background label="Lorem ipsum dolor">
73
+ This address is already in use.
74
+ </sonic-alert>
75
+ <sonic-alert status="success" background label="Lorem ipsum dolor">
76
+ This address is already in use.
77
+ </sonic-alert>
78
+ <sonic-alert status="error" background label="Lorem ipsum dolor">
79
+ This address is already in use.
80
+ </sonic-alert>
81
+ <sonic-alert status="warning" background label="Lorem ipsum dolor">
82
+ This address is already in use.
83
+ </sonic-alert>
84
+ <sonic-alert status="info" background label="Lorem ipsum dolor">
85
+ This address is already in use.
86
+ </sonic-alert>
87
+ </div>
88
+ </template>
89
+ </sonic-code>
90
+
91
+ ## Dismissible
92
+
93
+ <sonic-code>
94
+ <template>
95
+ <sonic-alert class="mb-3" dismissible label="Lorem ipsum dolor">
96
+ This address is already in use.
97
+ </sonic-alert>
98
+ <sonic-alert status="success" class="mb-3" dismissible label="Lorem ipsum dolor">
99
+ This address is already in use.
100
+ </sonic-alert>
101
+ <sonic-alert status="error" class="mb-3" dismissible label="Lorem ipsum dolor">
102
+ This address is already in use.
103
+ </sonic-alert>
104
+ <sonic-alert status="warning" class="mb-3" dismissible label="Lorem ipsum dolor">
105
+ This address is already in use.
106
+ </sonic-alert>
107
+ <sonic-alert status="info" class="mb-3" dismissible label="Lorem ipsum dolor">
108
+ This address is already in use.
109
+ </sonic-alert>
110
+ </template>
111
+ </sonic-code>
112
+
113
+ ## Dismiss forever
114
+
115
+ <sonic-code>
116
+ <template>
117
+ <sonic-alert class="mb-3" dismissible dismissForever label="Lorem ipsum dolor" id="addressUniqueId">
118
+ This address is already in use.
119
+ </sonic-alert>
120
+ </template>
121
+ </sonic-code>
@@ -0,0 +1,127 @@
1
+ # Badge
2
+
3
+ ## Type
4
+ <sonic-code>
5
+ <template>
6
+ <sonic-badge>Default</sonic-badge>
7
+ <sonic-badge type="primary">Primary</sonic-badge>
8
+ <sonic-badge type="neutral">Neutral</sonic-badge>
9
+ <sonic-badge type="warning">Warning</sonic-badge>
10
+ <sonic-badge type="info">Info</sonic-badge>
11
+ <sonic-badge type="success">Success</sonic-badge>
12
+ <sonic-badge type="danger">Danger</sonic-badge>
13
+ <sonic-badge type="contrast">Contrast</sonic-badge>
14
+ </template>
15
+ </sonic-code>
16
+
17
+
18
+ ## Outline
19
+ <sonic-code>
20
+ <template>
21
+ <div class="flex items-center flex-wrap gap-3">
22
+ <sonic-badge variant="outline">Default</sonic-badge>
23
+ <sonic-badge variant="outline" type="primary">Primary</sonic-badge>
24
+ <sonic-badge variant="outline" type="neutral">Neutral</sonic-badge>
25
+ <sonic-badge variant="outline" type="warning">Warning</sonic-badge>
26
+ <sonic-badge variant="outline" type="info">Info</sonic-badge>
27
+ <sonic-badge variant="outline" type="success">Success</sonic-badge>
28
+ <sonic-badge variant="outline" type="danger">Danger</sonic-badge>
29
+ <sonic-badge variant="outline" type="contrast">Contrast</sonic-badge>
30
+ </div>
31
+ </template>
32
+ </sonic-code>
33
+
34
+ ## Ghost
35
+ <sonic-code>
36
+ <template>
37
+ <div class="flex items-center flex-wrap gap-3">
38
+ <sonic-badge variant="ghost">Default</sonic-badge>
39
+ <sonic-badge variant="ghost" type="primary">Primary</sonic-badge>
40
+ <sonic-badge variant="ghost" type="neutral">Neutral</sonic-badge>
41
+ <sonic-badge variant="ghost" type="warning">Warning</sonic-badge>
42
+ <sonic-badge variant="ghost" type="info">Info</sonic-badge>
43
+ <sonic-badge variant="ghost" type="success">Success</sonic-badge>
44
+ <sonic-badge variant="ghost" type="danger">Danger</sonic-badge>
45
+ <sonic-badge variant="ghost" type="contrast">Contrast</sonic-badge>
46
+ </div>
47
+ </template>
48
+ </sonic-code>
49
+
50
+ ## Size
51
+ <sonic-code>
52
+ <template>
53
+ <sonic-badge size="2xs">2Xs badge</sonic-badge>
54
+ <sonic-badge size="xs">Xs badge</sonic-badge>
55
+ <sonic-badge size="sm">Sm badge</sonic-badge>
56
+ <sonic-badge>Md badge</sonic-badge>
57
+ <sonic-badge size="lg">Lg badge</sonic-badge>
58
+ <sonic-badge size="xl">Xl badge</sonic-badge>
59
+ <sonic-badge size="2xl">2Xl badge</sonic-badge>
60
+ </template>
61
+ </sonic-code>
62
+
63
+
64
+ ## Empty badges
65
+ <sonic-code>
66
+ <template>
67
+ <div class="flex items-center flex-wrap gap-3">
68
+ <sonic-badge type="danger" size="2xs"></sonic-badge>
69
+ <sonic-badge type="danger" size="xs"></sonic-badge>
70
+ <sonic-badge type="danger" size="sm"></sonic-badge>
71
+ <sonic-badge type="danger"></sonic-badge>
72
+ <sonic-badge type="danger" size="lg"></sonic-badge>
73
+ <sonic-badge type="danger" size="xl"></sonic-badge>
74
+ <sonic-badge type="danger" size="2xl"></sonic-badge>
75
+ </div>
76
+ </template>
77
+ </sonic-code>
78
+
79
+
80
+ ## Ellipsis
81
+ <sonic-code>
82
+ <template>
83
+ <div class="grid grid-cols-3 gap-4" >
84
+ <sonic-badge ellipsis size="sm" variant="outline" >
85
+ <sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon> Lorem ipsum dolor sit consectetur adipiscing elit. Lorem ipsum dolor sit consectetur adipiscing elit.</sonic-badge>
86
+ <sonic-badge ellipsis size="sm" > <sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon> Lorem ipsum dolor sit consectetur adipiscing elit. Lorem ipsum dolor sit consectetur adipiscing elit.</sonic-badge>
87
+ </div>
88
+ </template>
89
+ </sonic-code>
90
+
91
+ ## Badge in button
92
+ <sonic-code>
93
+ <template>
94
+ <div class="flex flex-wrap gap-4 items-center">
95
+ <sonic-button type="default">
96
+ Messages <sonic-badge slot="suffix" type="danger" size="xs">5</sonic-badge>
97
+ </sonic-button>
98
+ <div class="relative inline-block">
99
+ <sonic-button type="success" class="relative"> Mon compte </sonic-button>
100
+ <sonic-badge type="danger" size="xs" class="absolute right-1 top-0 pe-none transform -translate-y-1/2"
101
+ >12</sonic-badge
102
+ >
103
+ </div>
104
+ <div class="relative inline-block">
105
+ <sonic-button type="neutral" shape="circle" variant="outline"
106
+ ><sonic-icon library="iconoir" name="user"></sonic-icon>
107
+ </sonic-button>
108
+ <sonic-badge
109
+ type="danger"
110
+ size="xs"
111
+ class="absolute right-1 bottom-1 pe-none transform translate-y-1/2 translate-x-1/2"
112
+ >33</sonic-badge
113
+ >
114
+ </div>
115
+ <div class="relative inline-block">
116
+ <sonic-button type="neutral" shape="circle" variant="outline"
117
+ ><sonic-icon library="iconoir" name="user"></sonic-icon>
118
+ </sonic-button>
119
+ <sonic-badge
120
+ type="danger"
121
+ size="xs"
122
+ class="absolute right-2 bottom-2 pe-none transform translate-y-1/2 translate-x-1/2"
123
+ ></sonic-badge>
124
+ </div>
125
+ </div>
126
+ </template>
127
+ </sonic-code>
@@ -0,0 +1,184 @@
1
+ # Button
2
+
3
+
4
+
5
+ ## Type
6
+ <sonic-code>
7
+ <template>
8
+ <div class="flex flex-wrap gap-2">
9
+ <sonic-button>Default</sonic-button>
10
+ <sonic-button type="primary">Primary</sonic-button>
11
+ <sonic-button type="neutral">Neutral</sonic-button>
12
+ <sonic-button type="warning">Warning</sonic-button>
13
+ <sonic-button type="info">Info</sonic-button>
14
+ <sonic-button type="success">Success</sonic-button>
15
+ <sonic-button type="danger">Danger</sonic-button>
16
+ <sonic-button type="custom" style="--sc-btn-custom-color: #fde68a; --sc-btn-custom-bg: #5b21b6">Custom</sonic-button>
17
+ </div>
18
+ </template>
19
+ </sonic-code>
20
+
21
+ ## Outline
22
+ <sonic-code>
23
+ <template>
24
+ <div class="flex flex-wrap gap-2">
25
+ <sonic-button variant="outline">Default</sonic-button>
26
+ <sonic-button variant="outline" type="primary">Primary</sonic-button>
27
+ <sonic-button variant="outline" type="neutral">Neutral</sonic-button>
28
+ <sonic-button variant="outline" type="warning">Warning</sonic-button>
29
+ <sonic-button variant="outline" type="info">Info</sonic-button>
30
+ <sonic-button variant="outline" type="success">Success</sonic-button>
31
+ <sonic-button variant="outline" type="danger">Danger</sonic-button>
32
+ <sonic-button variant="outline" type="custom" style="--sc-btn-custom-bg: #5b21b6">Custom</sonic-button>
33
+ </div>
34
+ </template>
35
+ </sonic-code>
36
+
37
+ ## Variant
38
+ <sonic-code>
39
+ <template>
40
+ <sonic-button variant="default">Default</sonic-button>
41
+ <sonic-button variant="outline">Outline</sonic-button>
42
+ <sonic-button variant="ghost">Ghost</sonic-button>
43
+ <sonic-button variant="link">Link</sonic-button>
44
+ <sonic-button variant="unstyled">Unstyled</sonic-button>
45
+ </template>
46
+ </sonic-code>
47
+
48
+ ## Size
49
+ <sonic-code>
50
+ <template>
51
+ <sonic-button size="2xs">2Xs button</sonic-button>
52
+ <sonic-button size="xs">Xs button</sonic-button>
53
+ <sonic-button size="sm">Sm button</sonic-button>
54
+ <sonic-button size="md">Md button</sonic-button>
55
+ <sonic-button>Default button</sonic-button>
56
+ <sonic-button size="lg">Lg button</sonic-button>
57
+ <sonic-button size="xl">Xl button</sonic-button>
58
+ <sonic-button size="2xl">2Xl button</sonic-button>
59
+ </template>
60
+ </sonic-code>
61
+
62
+ ## Shape
63
+ <sonic-code>
64
+ <template>
65
+ <sonic-button shape="circle"> 😂 </sonic-button>
66
+ <sonic-button shape="square"> 🚀 </sonic-button>
67
+ </template>
68
+ </sonic-code>
69
+
70
+ ## Loading
71
+ The length of the button depends on the size of its content
72
+ <sonic-code>
73
+ <template>
74
+ <sonic-button loading></sonic-button>
75
+ <sonic-button loading>Loading button</sonic-button>
76
+ </template>
77
+ </sonic-code>
78
+
79
+ ## Swap
80
+ <sonic-code>
81
+ <template>
82
+ <sonic-button formDataProvider="button_swap_example" name="youpi" value="youpla" type="primary" shape="circle" variant="outline" class="mr-4">
83
+ <sonic-icon library="iconoir" swap="on" name="eye-empty"></sonic-icon>
84
+ <sonic-icon library="iconoir" swap="off" name="eye-off"></sonic-icon>
85
+ </sonic-button>
86
+ <sonic-button formDataProvider="button_swap_example" name="youpi" value="youpla" type="primary" variant="outline">
87
+ <sonic-icon library="iconoir" swap="on" slot="prefix" name="eye-empty"></sonic-icon>
88
+ <sonic-icon library="iconoir" swap="off" slot="prefix" name="eye-off"></sonic-icon>
89
+ Révélez
90
+ <span swap="off">...</span>
91
+ <span swap="on">moi !</span>
92
+ </sonic-button>
93
+ </template>
94
+ </sonic-code>
95
+
96
+ ## Reset
97
+ <sonic-code>
98
+ <template>
99
+ <div formDataProvider="button-reset-demo" class="mb-2">
100
+ <sonic-checkbox name="aChexbox" value="AValueToSet">Set A value</sonic-checkbox><br>
101
+ <sonic-button reset>Reset current formDataProvider</sonic-button>
102
+ </div>
103
+ <sonic-button reset="button-reset-demo">Reset formDataProvider by name</sonic-button>
104
+ </template>
105
+ </sonic-code>
106
+
107
+
108
+ ## GoBack
109
+ <sonic-code>
110
+ <template>
111
+ <sonic-button goBack type="primary" variant="outline" class="mr-4">
112
+ <sonic-icon library="iconoir" slot="prefix" name="arrow-left"></sonic-icon>
113
+ Retour classique
114
+ </sonic-button>
115
+ <sonic-button goBack="http://la-billetterie.net" type="primary" variant="outline" class="mr-4">
116
+ <sonic-icon library="iconoir" slot="prefix" name="arrow-left"></sonic-icon>
117
+ Retour url prédéfinie
118
+ </sonic-button>
119
+ </template>
120
+ </sonic-code>
121
+
122
+ ## Button with icon
123
+ <sonic-code>
124
+ <template>
125
+ <sonic-button goBack type="primary" variant="outline" class="mr-4">
126
+ <sonic-icon library="iconoir" slot="prefix" name="arrow-right" ></sonic-icon>
127
+ Button with icon
128
+ </sonic-button>
129
+ </template>
130
+ </sonic-code>
131
+
132
+
133
+ ## Button group
134
+ <sonic-code>
135
+ <template>
136
+ <sonic-group label="Code promo" class="mr-4">
137
+ <sonic-input placeholder="Entrez votre code ici..."></sonic-input>
138
+ <sonic-button type="primary" shape="square">
139
+ <sonic-icon library="iconoir" library="iconoir" name="gift"></sonic-icon>
140
+ </sonic-button>
141
+ </sonic-group>
142
+ <sonic-divider size="lg"></sonic-divider>
143
+ <div class="text-lg mb-2">Choose a subscription</div>
144
+ <sonic-group formDataProvider="subscriptionData">
145
+ <sonic-button radio minWidth="10rem" name="subscription" value="standard" type="default"
146
+ >😎 Standard</sonic-button
147
+ >
148
+ <sonic-button radio minWidth="10rem" name="subscription" value="premium" type="default">⭐ Premium</sonic-button>
149
+ <sonic-button radio minWidth="10rem" name="subscription" value="diamond" type="default">💎 Diamond</sonic-button>
150
+ </sonic-group>
151
+ </template>
152
+ </sonic-code>
153
+
154
+
155
+ ## Aria-label
156
+ <sonic-code>
157
+ <template>
158
+ <sonic-button data-aria-label="Custom aria label" type="primary" >
159
+ Button with aria label
160
+ </sonic-button>
161
+ <sonic-button data-aria-label="Custom aria label" href="https://google.fr" type="primary" >
162
+ Button link with aria label
163
+ </sonic-button>
164
+ </template>
165
+ </sonic-code>
166
+
167
+
168
+ ## Custom styles & active states with tailwind
169
+ <sonic-code>
170
+ <template>
171
+ <div formDataProvider="subscriptionData2">
172
+ <sonic-button
173
+ class="bg-neutral-100 transition-all text-center text-lg text-neutral-400 rounded-md min-w-[8rem] [&[active]]:text-danger-content [&[active]]:min-w-[13rem] [&[active]]:bg-danger [&[active]]:font-black [&[active]]:rounded-full"
174
+ variant="unstyled"
175
+ checkable unique
176
+ name="subscription"
177
+ value="premium"
178
+ type="default">
179
+ <span swap="off" class="inline-block py-2 px-3" >subscribe</span>
180
+ <span swap="on" class="inline-block py-2 px-3" >⭐ Premium</span>
181
+ </sonic-button>
182
+ </div>
183
+ </template>
184
+ </sonic-code>
@@ -0,0 +1,12 @@
1
+ # Captcha
2
+
3
+ <sonic-code>
4
+ <template>
5
+ <sonic-captcha formDataProvider="captchaTestDataProvider" key="6Leq5V0iAAAAAB-41DlWN335jDlcIuXmhNtdd00t">
6
+ <sonic-submit serviceURL="https://reqres.in" endPoint="api/unknown" onclick>
7
+ <sonic-button>Submit with captcha</sonic-button>
8
+ </sonic-submit>
9
+ </sonic-captcha>
10
+ </template>
11
+ </sonic-code>
12
+