@typlog/ui 0.11.8 → 0.12.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/addons.css CHANGED
@@ -1,4 +1,42 @@
1
1
 
2
+ .ui-SocialButton:where(.r-variant-classic) {
3
+ background-color: var(--social-button-background-color);
4
+ color: var(--social-button-text-color);
5
+ box-shadow: 0px 1px 2px 0px #0A0D120D, 0px -2px 0px 0px #0A0D120D inset, 0px 0px 0px 1px #0A0D122E inset;
6
+ --social-button-background-color: black;
7
+ --social-button-text-color: white;
8
+ --social-button-hover-filter: brightness(0.92) saturate(1.1);
9
+ }
10
+ @media (hover: hover) {
11
+ .ui-SocialButton:where(:hover) {
12
+ filter: var(--social-button-hover-filter);
13
+ }
14
+ }
15
+ .ui-SocialButton:where(.r-brand-google) {
16
+ --social-button-background-color: var(--color-background);
17
+ --social-button-text-color: var(--gray-12);
18
+ }
19
+ .ui-SocialButton:where(.r-brand-facebook) {
20
+ --social-button-background-color: #1877F2;
21
+ }
22
+ .ui-SocialButton:where(.r-brand-github) {
23
+ --social-button-background-color: #333;
24
+ }
25
+ .ui-SocialButton:where(.r-variant-classic):where(.r-brand-slack) {
26
+ --social-button-background-color: #611f69;
27
+ }
28
+ .ui-SocialButton:where(.r-variant-classic):where(:focus-visible) {
29
+ outline: 2px solid var(--focus-8);
30
+ outline-offset: 2px;
31
+ }
32
+ .ui-SocialButton:where(.r-variant-classic):where(:active) {
33
+ box-shadow: var(--shadow-1);
34
+ }
35
+ .ui-SocialButton:where(.r-variant-classic):where([data-disabled]) {
36
+ color: var(--gray-a10);
37
+ background-color: var(--gray-a2);
38
+ }
39
+
2
40
  .ui-IconifySample {
3
41
  display: flex;
4
42
  gap: var(--space-4);
@@ -111,3 +149,15 @@
111
149
  .ui-IconifyCollectionIconGrid button:hover {
112
150
  background-color: var(--gray-a4);
113
151
  }
152
+
153
+ .ui-Turnstile {
154
+ background: var(--gray-a3);
155
+ }
156
+ .ui-Turnstile:where(.r-size-normal) {
157
+ width: 300px;
158
+ height: 65px;
159
+ }
160
+ .ui-Turnstile:where(.r-size-compact) {
161
+ width: 150px;
162
+ height: 140px;
163
+ }
package/addons.d.ts CHANGED
@@ -1,8 +1,19 @@
1
+ import { AsTag } from 'reka-ui';
2
+ import { Component } from 'vue';
1
3
  import { ComponentOptionsMixin } from 'vue';
2
4
  import { ComponentProvideOptions } from 'vue';
3
5
  import { DefineComponent } from 'vue';
6
+ import { PrimitiveProps } from 'reka-ui';
4
7
  import { PublicProps } from 'vue';
5
8
 
9
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
14
+
15
+ declare type BrandType = 'google' | 'facebook' | 'x' | 'github' | 'apple' | 'slack' | 'figma';
16
+
6
17
  export declare const IconifyCollection: DefineComponent<IconifyCollectionProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
7
18
  select: (icon: string) => any;
8
19
  }, string, PublicProps, Readonly<IconifyCollectionProps> & Readonly<{
@@ -12,13 +23,35 @@ perpage: number;
12
23
  iconSize: string | number;
13
24
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
14
25
 
15
- declare interface IconifyCollectionProps {
26
+ export declare interface IconifyCollectionProps {
16
27
  prefix?: string;
17
28
  search?: string;
18
29
  perpage?: number;
19
30
  iconSize?: string | number;
20
31
  }
21
32
 
33
+ declare type RadiusType = 'none' | 'small' | 'medium' | 'large' | 'full';
34
+
35
+ export declare const SocialButton: __VLS_WithTemplateSlots<DefineComponent<SocialButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SocialButtonProps> & Readonly<{}>, {
36
+ as: AsTag | Component;
37
+ size: "1" | "2" | "3" | "4";
38
+ variant: "classic" | "solid" | "soft" | "surface" | "outline";
39
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, {
40
+ default?(_: {}): any;
41
+ }>;
42
+
43
+ export declare interface SocialButtonProps extends PrimitiveProps {
44
+ brand: BrandType;
45
+ variant?: 'classic' | 'solid' | 'soft' | 'surface' | 'outline';
46
+ radius?: RadiusType;
47
+ /**
48
+ * Control the size of the social button.
49
+ * @default "2"
50
+ */
51
+ size?: '1' | '2' | '3' | '4';
52
+ disabled?: boolean;
53
+ }
54
+
22
55
  export declare const Turnstile: DefineComponent<TurnstileProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
23
56
  "update:modelValue": (args_0: string) => any;
24
57
  }, string, PublicProps, Readonly<TurnstileProps> & Readonly<{
@@ -26,8 +59,8 @@ export declare const Turnstile: DefineComponent<TurnstileProps, {}, {}, {}, {},
26
59
  }>, {
27
60
  size: "normal" | "compact";
28
61
  theme: "light" | "dark" | "auto";
29
- resetInterval: number;
30
62
  action: string;
63
+ resetInterval: number;
31
64
  appearance: "always" | "execute" | "interaction-only";
32
65
  renderOnMount: boolean;
33
66
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
package/addons.js CHANGED
@@ -1,6 +1,53 @@
1
- import { defineComponent, createElementBlock, openBlock, createElementVNode, toDisplayString, Fragment, renderList, createVNode, unref, ref, computed, onMounted, withDirectives, createCommentVNode, withKeys, createBlock, mergeProps, withModifiers, vShow, withCtx, createTextVNode, normalizeStyle, useTemplateRef, onBeforeUnmount } from "vue";
1
+ import { defineComponent, computed, createBlock, openBlock, unref, normalizeClass, withCtx, createCommentVNode, renderSlot, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, createVNode, ref, onMounted, withDirectives, withKeys, mergeProps, withModifiers, vShow, createTextVNode, normalizeStyle, useTemplateRef, onBeforeUnmount } from "vue";
2
+ import { Primitive, injectDialogRootContext } from "reka-ui";
2
3
  import { Icon } from "@iconify/vue";
3
- import { TextField, Button, Tooltip, Pagination } from "./components";
4
+ import { buildPropsClass, TextField, Button, Tooltip, Pagination } from "./components";
5
+ const BRAND_ICONS = {
6
+ google: "logos:google-icon",
7
+ facebook: "simple-icons:facebook",
8
+ x: "simple-icons:x",
9
+ github: "simple-icons:github",
10
+ apple: "simple-icons:apple",
11
+ slack: "logos:slack-icon",
12
+ figma: "logos:figma"
13
+ };
14
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
15
+ __name: "SocialButton",
16
+ props: {
17
+ brand: {},
18
+ variant: { default: "classic" },
19
+ radius: {},
20
+ size: { default: "2" },
21
+ disabled: { type: Boolean },
22
+ asChild: { type: Boolean },
23
+ as: { default: "button" }
24
+ },
25
+ setup(__props) {
26
+ const props = __props;
27
+ const resetClass = buildPropsClass(props, ["size", "brand", "variant"]);
28
+ const brandIcon = computed(() => {
29
+ return BRAND_ICONS[props.brand];
30
+ });
31
+ return (_ctx, _cache) => {
32
+ return openBlock(), createBlock(unref(Primitive), {
33
+ class: normalizeClass(["ui-Button ui-SocialButton", unref(resetClass)]),
34
+ "as-child": props.asChild,
35
+ as: props.as,
36
+ "data-radius": props.radius,
37
+ "data-disabled": props.disabled ? true : void 0
38
+ }, {
39
+ default: withCtx(() => [
40
+ brandIcon.value ? (openBlock(), createBlock(unref(Icon), {
41
+ key: 0,
42
+ icon: brandIcon.value
43
+ }, null, 8, ["icon"])) : createCommentVNode("", true),
44
+ renderSlot(_ctx.$slots, "default")
45
+ ]),
46
+ _: 3
47
+ }, 8, ["class", "as-child", "as", "data-radius", "data-disabled"]);
48
+ };
49
+ }
50
+ });
4
51
  const _hoisted_1$1 = {
5
52
  type: "button",
6
53
  class: "ui-IconifySample"
@@ -117,6 +164,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
117
164
  setup(__props, { emit: __emit }) {
118
165
  const props = __props;
119
166
  const emits = __emit;
167
+ const dialogContext = injectDialogRootContext(null);
120
168
  const shouldDisplay = ref("all");
121
169
  const groupCollections = ref([]);
122
170
  const collectionFilter = ref("");
@@ -137,6 +185,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
137
185
  };
138
186
  const onSelectIcon = (icon) => {
139
187
  emits("select", icon);
188
+ if (dialogContext) {
189
+ dialogContext.onOpenChange(false);
190
+ }
140
191
  };
141
192
  const onSearch = async () => {
142
193
  if (searchQuery.value) {
@@ -274,7 +325,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
274
325
  onClick: withModifiers(reset, ["prevent"])
275
326
  }, {
276
327
  default: withCtx(() => _cache[5] || (_cache[5] = [
277
- createTextVNode(" Back ")
328
+ createTextVNode(" Back ", -1)
278
329
  ])),
279
330
  _: 1,
280
331
  __: [5]
@@ -431,12 +482,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
431
482
  return openBlock(), createElementBlock("div", {
432
483
  ref_key: "element",
433
484
  ref: element,
434
- class: "ui-Turnstile"
435
- }, null, 512);
485
+ class: normalizeClass(["ui-Turnstile", `r-size-${_ctx.size}`])
486
+ }, null, 2);
436
487
  };
437
488
  }
438
489
  });
439
490
  export {
440
491
  _sfc_main$1 as IconifyCollection,
492
+ _sfc_main$3 as SocialButton,
441
493
  _sfc_main as Turnstile
442
494
  };
package/base.css CHANGED
@@ -6427,66 +6427,6 @@
6427
6427
  --scaling: 1.2;
6428
6428
  }
6429
6429
 
6430
- html.light {
6431
- --light-0: white;
6432
- --light-a1: var(--white-a1);
6433
- --light-a2: var(--white-a2);
6434
- --light-a3: var(--white-a3);
6435
- --light-a4: var(--white-a4);
6436
- --light-a5: var(--white-a5);
6437
- --light-a6: var(--white-a6);
6438
- --light-a7: var(--white-a7);
6439
- --light-a8: var(--white-a8);
6440
- --light-a9: var(--white-a9);
6441
- --light-a10: var(--white-a10);
6442
- --light-a11: var(--white-a11);
6443
- --light-a12: var(--white-a12);
6444
- --dark-0: black;
6445
- --dark-a1: var(--black-a1);
6446
- --dark-a2: var(--black-a2);
6447
- --dark-a3: var(--black-a3);
6448
- --dark-a4: var(--black-a4);
6449
- --dark-a5: var(--black-a5);
6450
- --dark-a6: var(--black-a6);
6451
- --dark-a7: var(--black-a7);
6452
- --dark-a8: var(--black-a8);
6453
- --dark-a9: var(--black-a9);
6454
- --dark-a10: var(--black-a10);
6455
- --dark-a11: var(--black-a11);
6456
- --dark-a12: var(--black-a12);
6457
- --light-surface: white;
6458
- }
6459
-
6460
- html.dark {
6461
- --light-0: black;
6462
- --light-a1: var(--black-a1);
6463
- --light-a2: var(--black-a2);
6464
- --light-a3: var(--black-a3);
6465
- --light-a4: var(--black-a4);
6466
- --light-a5: var(--black-a5);
6467
- --light-a6: var(--black-a6);
6468
- --light-a7: var(--black-a7);
6469
- --light-a8: var(--black-a8);
6470
- --light-a9: var(--black-a9);
6471
- --light-a10: var(--black-a10);
6472
- --light-a11: var(--black-a11);
6473
- --light-a12: var(--black-a12);
6474
- --dark-0: white;
6475
- --dark-a1: var(--white-a1);
6476
- --dark-a2: var(--white-a2);
6477
- --dark-a3: var(--white-a3);
6478
- --dark-a4: var(--white-a4);
6479
- --dark-a5: var(--white-a5);
6480
- --dark-a6: var(--white-a6);
6481
- --dark-a7: var(--white-a7);
6482
- --dark-a8: var(--white-a8);
6483
- --dark-a9: var(--white-a9);
6484
- --dark-a10: var(--white-a10);
6485
- --dark-a11: var(--white-a11);
6486
- --dark-a12: var(--white-a12);
6487
- --light-surface: var(--slate-a1);
6488
- }
6489
-
6490
6430
  [data-radius] {
6491
6431
  --radius-1: calc(3px * var(--scaling) * var(--radius-factor));
6492
6432
  --radius-2: calc(4px * var(--scaling) * var(--radius-factor));
@@ -6790,6 +6730,15 @@ html.dark {
6790
6730
  }
6791
6731
  }
6792
6732
 
6733
+ @keyframes ui-spin {
6734
+ from {
6735
+ transform: rotate(0);
6736
+ }
6737
+ to {
6738
+ transform: rotate(360deg);
6739
+ }
6740
+ }
6741
+
6793
6742
  .ui-root {
6794
6743
  --font-size-1: calc(12px * var(--scaling));
6795
6744
  --font-size-2: calc(14px * var(--scaling));
@@ -6836,3 +6785,10 @@ html.dark {
6836
6785
  -webkit-font-smoothing: antialiased;
6837
6786
  -moz-osx-font-smoothing: grayscale;
6838
6787
  }
6788
+
6789
+ .ui-root {
6790
+ --tab-active-letter-spacing: -0.01em;
6791
+ --tab-active-word-spacing: 0em;
6792
+ --tab-inactive-letter-spacing: 0em;
6793
+ --tab-inactive-word-spacing: 0em;
6794
+ }
@@ -9,6 +9,8 @@
9
9
  line-height: 1;
10
10
  height: -moz-fit-content;
11
11
  height: fit-content;
12
+ width: -moz-fit-content;
13
+ width: fit-content;
12
14
  }
13
15
  .ui-Badge:where(.r-size-1) {
14
16
  font-size: var(--font-size-1);
@@ -18,6 +20,9 @@
18
20
  gap: calc(var(--space-1) * 1.5);
19
21
  border-radius: max(var(--radius-1), var(--radius-full));
20
22
  }
23
+ .ui-Badge:where(.r-size-1):where([data-radius="full"]) {
24
+ padding: calc(var(--space-1) * 0.5) var(--space-2);
25
+ }
21
26
  .ui-Badge:where(.r-size-2) {
22
27
  font-size: var(--font-size-1);
23
28
  line-height: var(--line-height-1);
@@ -26,6 +31,9 @@
26
31
  gap: calc(var(--space-1) * 1.5);
27
32
  border-radius: max(var(--radius-2), var(--radius-full));
28
33
  }
34
+ .ui-Badge:where(.r-size-2):where([data-radius="full"]) {
35
+ padding: var(--space-1) calc(var(--space-2) * 1.25);
36
+ }
29
37
  .ui-Badge:where(.r-size-3) {
30
38
  font-size: var(--font-size-2);
31
39
  line-height: var(--line-height-2);
@@ -34,6 +42,9 @@
34
42
  gap: var(--space-2);
35
43
  border-radius: max(var(--radius-2), var(--radius-full));
36
44
  }
45
+ .ui-Badge:where(.r-size-3):where([data-radius="full"]) {
46
+ padding: var(--space-1) calc(var(--space-2) * 1.5);
47
+ }
37
48
  .ui-Badge:where(.r-variant-solid) {
38
49
  background-color: var(--accent-9);
39
50
  color: var(--accent-contrast);
@@ -1,4 +1,3 @@
1
-
2
1
  .ui-Button {
3
2
  display: inline-flex;
4
3
  align-items: center;
@@ -258,41 +257,3 @@
258
257
  width: var(--button-height);
259
258
  padding: 0;
260
259
  }
261
-
262
- .ui-SocialButton {
263
- background-color: var(--social-button-background-color);
264
- color: var(--social-button-text-color);
265
- box-shadow: 0px 1px 2px 0px #0A0D120D, 0px -2px 0px 0px #0A0D120D inset, 0px 0px 0px 1px #0A0D122E inset;
266
- --social-button-background-color: black;
267
- --social-button-text-color: white;
268
- --social-button-hover-filter: brightness(0.92) saturate(1.1);
269
- }
270
- @media (hover: hover) {
271
- .ui-SocialButton:where(:hover) {
272
- filter: var(--social-button-hover-filter);
273
- }
274
- }
275
- .ui-SocialButton:where(.r-brand-google) {
276
- background-color: var(--color-background);
277
- --social-button-text-color: var(--gray-12);
278
- }
279
- .ui-SocialButton:where(.r-brand-facebook) {
280
- --social-button-background-color: #1877F2;
281
- }
282
- .ui-SocialButton:where(.r-brand-github) {
283
- --social-button-background-color: #333;
284
- }
285
- .ui-SocialButton:where(.r-brand-slack) {
286
- --social-button-background-color: #611f69;
287
- }
288
- .ui-SocialButton:where(:focus-visible) {
289
- outline: 2px solid var(--focus-8);
290
- outline-offset: 2px;
291
- }
292
- .ui-SocialButton:where(:active) {
293
- box-shadow: var(--shadow-1);
294
- }
295
- .ui-SocialButton:where([data-disabled]) {
296
- color: var(--gray-a10);
297
- background-color: var(--gray-a2);
298
- }
@@ -1,35 +1,4 @@
1
1
 
2
- .ui-Card {
3
- display: block;
4
- position: relative;
5
- overflow: hidden;
6
- font-style: normal;
7
- text-align: start;
8
- box-sizing: border-box;
9
- border-radius: var(--card-border-radius);
10
- padding: var(--card-padding);
11
- border-color: var(--card-border-color, var(--gray-a5));
12
- border-width: var(--card-border-width, 1px);
13
- border-style: solid;
14
- --inset-padding-top: var(--card-padding);
15
- --inset-padding-right: var(--card-padding);
16
- --inset-padding-bottom: var(--card-padding);
17
- --inset-padding-left: var(--card-padding);
18
- }
19
- .ui-Card:where(:-moz-any-link, button, label):where(:hover) {
20
- --card-border-color: var(--gray-a7);
21
- }
22
- .ui-Card:where(:any-link, button, label):where(:hover) {
23
- --card-border-color: var(--gray-a7);
24
- }
25
- .ui-Card:where(:-moz-any-link, button, label):where(:focus-visible) {
26
- --card-border-color: var(--focus-8);
27
- box-shadow: 0 0 0 2px var(--accent-4), 0 1px 2px 0 rgb(0 0 0 / 0.05);
28
- }
29
- .ui-Card:where(:any-link, button, label):where(:focus-visible) {
30
- --card-border-color: var(--focus-8);
31
- box-shadow: 0 0 0 2px var(--accent-4), 0 1px 2px 0 rgb(0 0 0 / 0.05);
32
- }
33
2
  .ui-Card:where(.r-size-1) {
34
3
  --card-padding: var(--space-3);
35
4
  --card-border-radius: max(var(--radius-4), var(--radius-full));
@@ -60,27 +29,3 @@
60
29
  .ui-Card:where(.r-variant-soft):where(:any-link, button, label):where(:hover) {
61
30
  border-color: var(--gray-a5);
62
31
  }
63
-
64
- .ui-CardHead {
65
- display: flex;
66
- align-items: center;
67
- justify-content: space-between;
68
- margin-left: calc(0px - var(--card-padding));
69
- margin-right: calc(0px - var(--card-padding));
70
- margin-top: calc(0px - var(--card-padding));
71
- padding: var(--card-padding);
72
- --card-head-border-color: var(--card-border-color, var(--gray-a5));
73
- border-bottom: 1px solid var(--card-head-border-color);
74
- }
75
- .ui-CardHead:where(:-moz-any-link, button, label):where(:hover) {
76
- background-color: var(--accent-a3);
77
- }
78
- .ui-CardHead:where(:any-link, button, label):where(:hover) {
79
- background-color: var(--accent-a3);
80
- }
81
- .ui-CardHead:where(:-moz-any-link, button, label):where(:focus-visible) {
82
- background-color: var(--accent-a4);
83
- }
84
- .ui-CardHead:where(:any-link, button, label):where(:focus-visible) {
85
- background-color: var(--accent-a4);
86
- }