@infonomic/uikit 5.3.0 → 5.5.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.
Files changed (70) hide show
  1. package/dist/astro.d.ts +51 -0
  2. package/dist/astro.js +51 -0
  3. package/dist/components/accordion/accordion.module.css +60 -0
  4. package/dist/components/avatar/avatar.module.css +54 -0
  5. package/dist/components/badge/badge.module.css +61 -0
  6. package/dist/components/button/button-group.module.css +19 -0
  7. package/dist/components/button/button.astro +86 -0
  8. package/dist/components/button/button.module.css +431 -0
  9. package/dist/components/button/control-buttons.module.css +132 -0
  10. package/dist/components/button/copy-button.module.css +56 -0
  11. package/dist/components/button/icon-button.astro +47 -0
  12. package/dist/components/card/card-content.astro +14 -0
  13. package/dist/components/card/card-description.astro +14 -0
  14. package/dist/components/card/card-footer.astro +14 -0
  15. package/dist/components/card/card-header.astro +14 -0
  16. package/dist/components/card/card-title.astro +14 -0
  17. package/dist/components/card/card.astro +41 -0
  18. package/dist/components/card/card.module.css +77 -0
  19. package/dist/components/container/container.astro +13 -0
  20. package/dist/components/container/container.module.css +36 -0
  21. package/dist/components/dropdown/dropdown.module.css +120 -0
  22. package/dist/components/forms/calendar.module.css +269 -0
  23. package/dist/components/forms/checkbox.astro +129 -0
  24. package/dist/components/forms/checkbox.js +1 -1
  25. package/dist/components/forms/checkbox.module.css +211 -0
  26. package/dist/components/forms/error-text.astro +14 -0
  27. package/dist/components/forms/error-text.module.css +9 -0
  28. package/dist/components/forms/help-text.astro +13 -0
  29. package/dist/components/forms/help-text.module.css +9 -0
  30. package/dist/components/forms/input-adornment.astro +26 -0
  31. package/dist/components/forms/input-adornment.module.css +21 -0
  32. package/dist/components/forms/input.astro +99 -0
  33. package/dist/components/forms/input.module.css +278 -0
  34. package/dist/components/forms/label.astro +24 -0
  35. package/dist/components/forms/label.module.css +15 -0
  36. package/dist/components/forms/radio-group.module.css +163 -0
  37. package/dist/components/forms/select.module.css +68 -0
  38. package/dist/components/forms/text-area.astro +77 -0
  39. package/dist/components/forms/text-area.module.css +10 -0
  40. package/dist/components/hamburger/hamburger.astro +30 -0
  41. package/dist/components/notifications/alert.module.css +110 -0
  42. package/dist/components/notifications/toast.module.css +237 -0
  43. package/dist/components/overlay/overlay.module.css +41 -0
  44. package/dist/components/pager/pagination.module.css +149 -0
  45. package/dist/components/scroll-area/scroll-area.module.css +64 -0
  46. package/dist/components/scroll-to-top/scroll-to-top.astro +75 -0
  47. package/dist/components/scroll-to-top/scroll-to-top.module.css +86 -0
  48. package/dist/components/section/section.astro +13 -0
  49. package/dist/components/section/section.module.css +9 -0
  50. package/dist/components/shimmer/shimmer.module.css +53 -0
  51. package/dist/components/table/table.module.css +100 -0
  52. package/dist/components/tabs/tabs.module.css +66 -0
  53. package/dist/components/tooltip/tooltip.module.css +45 -0
  54. package/dist/icons/check-icon.astro +37 -0
  55. package/dist/icons/close-icon.astro +38 -0
  56. package/dist/icons/icon-element.astro +27 -0
  57. package/dist/icons/icons.module.css +155 -0
  58. package/dist/icons/light-icon.astro +36 -0
  59. package/dist/icons/moon-icon.astro +38 -0
  60. package/dist/icons/search-icon.astro +40 -0
  61. package/dist/widgets/datepicker/datepicker.module.css +189 -0
  62. package/dist/widgets/drawer/drawer.module.css +112 -0
  63. package/dist/widgets/modal/modal.module.css +81 -0
  64. package/dist/widgets/timeline/timeline.module.css +87 -0
  65. package/package.json +5 -4
  66. package/src/astro.js +6 -0
  67. package/src/components/forms/checkbox.astro +129 -0
  68. package/src/components/forms/checkbox.tsx +1 -1
  69. package/src/components/forms/text-area.astro +77 -0
  70. package/src/icons/check-icon.astro +37 -0
@@ -0,0 +1,51 @@
1
+ import type ButtonComponent from './components/button/button.astro'
2
+ import type IconButtonComponent from './components/button/icon-button.astro'
3
+ import type CardContentComponent from './components/card/card-content.astro'
4
+ import type CardDescriptionComponent from './components/card/card-description.astro'
5
+ import type CardFooterComponent from './components/card/card-footer.astro'
6
+ import type CardHeaderComponent from './components/card/card-header.astro'
7
+ import type CardTitleComponent from './components/card/card-title.astro'
8
+ import type CardComponent from './components/card/card.astro'
9
+ import type ContainerComponent from './components/container/container.astro'
10
+ import type CheckboxComponent from './components/forms/checkbox.astro'
11
+ import type ErrorTextComponent from './components/forms/error-text.astro'
12
+ import type HelpTextComponent from './components/forms/help-text.astro'
13
+ import type InputAdornmentComponent from './components/forms/input-adornment.astro'
14
+ import type InputComponent from './components/forms/input.astro'
15
+ import type LabelComponent from './components/forms/label.astro'
16
+ import type TextAreaComponent from './components/forms/text-area.astro'
17
+ import type HamburgerComponent from './components/hamburger/hamburger.astro'
18
+ import type ScrollToTopComponent from './components/scroll-to-top/scroll-to-top.astro'
19
+ import type SectionComponent from './components/section/section.astro'
20
+ import type CheckIconComponent from './icons/check-icon.astro'
21
+ import type CloseIconComponent from './icons/close-icon.astro'
22
+ import type IconElementComponent from './icons/icon-element.astro'
23
+ import type LightIconComponent from './icons/light-icon.astro'
24
+ import type MoonIconComponent from './icons/moon-icon.astro'
25
+ import type SearchIconComponent from './icons/search-icon.astro'
26
+
27
+ export declare const Button: typeof ButtonComponent
28
+ export declare const IconButton: typeof IconButtonComponent
29
+ export declare const CardContent: typeof CardContentComponent
30
+ export declare const CardDescription: typeof CardDescriptionComponent
31
+ export declare const CardFooter: typeof CardFooterComponent
32
+ export declare const CardHeader: typeof CardHeaderComponent
33
+ export declare const CardTitle: typeof CardTitleComponent
34
+ export declare const Card: typeof CardComponent
35
+ export declare const Container: typeof ContainerComponent
36
+ export declare const Checkbox: typeof CheckboxComponent
37
+ export declare const ErrorText: typeof ErrorTextComponent
38
+ export declare const HelpText: typeof HelpTextComponent
39
+ export declare const InputAdornment: typeof InputAdornmentComponent
40
+ export declare const Input: typeof InputComponent
41
+ export declare const Label: typeof LabelComponent
42
+ export declare const TextArea: typeof TextAreaComponent
43
+ export declare const Hamburger: typeof HamburgerComponent
44
+ export declare const ScrollToTop: typeof ScrollToTopComponent
45
+ export declare const Section: typeof SectionComponent
46
+ export declare const CheckIcon: typeof CheckIconComponent
47
+ export declare const CloseIcon: typeof CloseIconComponent
48
+ export declare const IconElement: typeof IconElementComponent
49
+ export declare const LightIcon: typeof LightIconComponent
50
+ export declare const MoonIcon: typeof MoonIconComponent
51
+ export declare const SearchIcon: typeof SearchIconComponent
package/dist/astro.js ADDED
@@ -0,0 +1,51 @@
1
+ import ButtonComponent from './components/button/button.astro'
2
+ import IconButtonComponent from './components/button/icon-button.astro'
3
+ import CardContentComponent from './components/card/card-content.astro'
4
+ import CardDescriptionComponent from './components/card/card-description.astro'
5
+ import CardFooterComponent from './components/card/card-footer.astro'
6
+ import CardHeaderComponent from './components/card/card-header.astro'
7
+ import CardTitleComponent from './components/card/card-title.astro'
8
+ import CardComponent from './components/card/card.astro'
9
+ import ContainerComponent from './components/container/container.astro'
10
+ import CheckboxComponent from './components/forms/checkbox.astro'
11
+ import ErrorTextComponent from './components/forms/error-text.astro'
12
+ import HelpTextComponent from './components/forms/help-text.astro'
13
+ import InputAdornmentComponent from './components/forms/input-adornment.astro'
14
+ import InputComponent from './components/forms/input.astro'
15
+ import LabelComponent from './components/forms/label.astro'
16
+ import TextAreaComponent from './components/forms/text-area.astro'
17
+ import HamburgerComponent from './components/hamburger/hamburger.astro'
18
+ import ScrollToTopComponent from './components/scroll-to-top/scroll-to-top.astro'
19
+ import SectionComponent from './components/section/section.astro'
20
+ import CheckIconComponent from './icons/check-icon.astro'
21
+ import CloseIconComponent from './icons/close-icon.astro'
22
+ import IconElementComponent from './icons/icon-element.astro'
23
+ import LightIconComponent from './icons/light-icon.astro'
24
+ import MoonIconComponent from './icons/moon-icon.astro'
25
+ import SearchIconComponent from './icons/search-icon.astro'
26
+
27
+ export const Button = ButtonComponent
28
+ export const IconButton = IconButtonComponent
29
+ export const CardContent = CardContentComponent
30
+ export const CardDescription = CardDescriptionComponent
31
+ export const CardFooter = CardFooterComponent
32
+ export const CardHeader = CardHeaderComponent
33
+ export const CardTitle = CardTitleComponent
34
+ export const Card = CardComponent
35
+ export const Container = ContainerComponent
36
+ export const Checkbox = CheckboxComponent
37
+ export const ErrorText = ErrorTextComponent
38
+ export const HelpText = HelpTextComponent
39
+ export const InputAdornment = InputAdornmentComponent
40
+ export const Input = InputComponent
41
+ export const Label = LabelComponent
42
+ export const TextArea = TextAreaComponent
43
+ export const Hamburger = HamburgerComponent
44
+ export const ScrollToTop = ScrollToTopComponent
45
+ export const Section = SectionComponent
46
+ export const CheckIcon = CheckIconComponent
47
+ export const CloseIcon = CloseIconComponent
48
+ export const IconElement = IconElementComponent
49
+ export const LightIcon = LightIconComponent
50
+ export const MoonIcon = MoonIconComponent
51
+ export const SearchIcon = SearchIconComponent
@@ -0,0 +1,60 @@
1
+ @layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
2
+
3
+ @layer infonomic-components {
4
+ .root {
5
+ border-radius: 6px;
6
+ width: 300px;
7
+ background-color: var(--canvas-25);
8
+ box-shadow: var(--shadow-md);
9
+ }
10
+
11
+ .item {
12
+ overflow: hidden;
13
+ margin-top: 1px;
14
+ }
15
+
16
+ .header {
17
+ margin: 0;
18
+ display: flex;
19
+ }
20
+
21
+ .trigger {
22
+ display: flex;
23
+ cursor: pointer;
24
+ align-items: center;
25
+ width: 100%;
26
+ }
27
+
28
+ .content {
29
+ overflow: hidden;
30
+
31
+ &[data-state="open"] {
32
+ animation: accordionSlideDown 300ms cubic-bezier(0.87, 0, 0.13, 1);
33
+ }
34
+
35
+ &[data-state="closed"] {
36
+ animation: accordionSlideUp 300ms cubic-bezier(0.87, 0, 0.13, 1);
37
+ }
38
+ }
39
+
40
+
41
+ @keyframes accordionSlideDown {
42
+ from {
43
+ height: 0;
44
+ }
45
+
46
+ to {
47
+ height: var(--radix-accordion-content-height);
48
+ }
49
+ }
50
+
51
+ @keyframes accordionSlideUp {
52
+ from {
53
+ height: var(--radix-accordion-content-height);
54
+ }
55
+
56
+ to {
57
+ height: 0;
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,54 @@
1
+ @layer infonomic-base, infonomic-functional, infonomic-utilities, infonomic-theme, infonomic-typography, infonomic-components;
2
+
3
+ @layer infonomic-components {
4
+
5
+ /* relative inline-flex h-10 w-10 rounded-full */
6
+ .avatar-root {
7
+ position: relative;
8
+ display: inline-flex;
9
+ height: 100%;
10
+ width: 100%;
11
+ border-radius: 50%;
12
+ }
13
+
14
+ .avatar-image {
15
+ height: 100%;
16
+ width: 100%;
17
+ border-radius: 50%;
18
+ object-fit: cover;
19
+ }
20
+
21
+ /* flex h-full w-full items-center justify-center rounded-full bg-white dark:bg-gray-800 */
22
+ .avatar-fallback {
23
+ display: flex;
24
+ height: 100%;
25
+ width: 100%;
26
+ align-items: center;
27
+ justify-content: center;
28
+ border-radius: 50%;
29
+ background-color: var(--color-white);
30
+ }
31
+
32
+
33
+ .avatar-text {
34
+ font-size: var(--font-size-sm);
35
+ font-weight: var(--font-weight-medium);
36
+ text-transform: uppercase;
37
+ color: var(--gray-700);
38
+ }
39
+
40
+ /* 🌙 Dark via `.dark` class. We rely on the
41
+ * consuming application to detect a user's preferred
42
+ * color scheme - either by header or cookie, and set
43
+ * a root html class accordingly
44
+ */
45
+ :global(.dark) {
46
+ .avatar-fallback {
47
+ background-color: var(--gray-800);
48
+ }
49
+
50
+ .avatar-text {
51
+ color: var(--gray-400);
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,61 @@
1
+ @layer infonomic-base, infonomic-functional, infonomic-utilities, infonomic-theme, infonomic-typography, infonomic-components;
2
+
3
+ @layer infonomic-components {
4
+ .badge,
5
+ :global(.badge) {
6
+ display: inline-block;
7
+ padding: 0.25em 0.4em;
8
+ font-size: var(--font-size-sm);
9
+ font-weight: 400;
10
+ line-height: 1;
11
+ text-align: center;
12
+ white-space: nowrap;
13
+ vertical-align: baseline;
14
+ border-radius: var(--border-radius-sm);
15
+ }
16
+
17
+ .primary,
18
+ :global(.badge-primary) {
19
+ color: var(--text-on-primary);
20
+ background-color: var(--fill-primary-strong);
21
+ }
22
+
23
+ .secondary,
24
+ :global(.badge-secondary) {
25
+ color: var(--text-on-secondary);
26
+ background-color: var(--fill-secondary-strong);
27
+ }
28
+
29
+ .noeffect,
30
+ :global(.badge-noeffect) {
31
+ color: var(--text-on-noeffect);
32
+ background-color: var(--fill-noeffect-strong);
33
+ }
34
+
35
+ .success,
36
+ :global(.badge-success) {
37
+ color: var(--text-on-success);
38
+ background-color: var(--fill-success-strong);
39
+ }
40
+
41
+ .info,
42
+ :global(.badge-info) {
43
+ color: var(--text-on-info);
44
+ background-color: var(--fill-info-strong);
45
+ }
46
+
47
+ .warning,
48
+ :global(.badge-warning) {
49
+ color: var(--text-on-warning);
50
+ background-color: var(--fill-warning-strong);
51
+ }
52
+
53
+ .danger,
54
+ :global(.badge-danger) {
55
+ color: var(--text-on-danger);
56
+ background-color: var(--fill-danger-strong);
57
+ }
58
+
59
+ /* Dark mode - All intents now handled by semantic tokens in theme layer */
60
+ /* No overrides needed! Tokens automatically switch in .dark and respect .not-dark */
61
+ }
@@ -0,0 +1,19 @@
1
+ @layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
2
+
3
+ @layer infonomic-components {
4
+ .button-group,
5
+ :global(.button-group) {
6
+ display: flex;
7
+ flex-direction: column;
8
+ align-items: center;
9
+ justify-items: center;
10
+ gap: var(--gap-2);
11
+ }
12
+
13
+ @media screen and (min-width: 40rem) {
14
+ .button-group,
15
+ :global(.button-group) {
16
+ flex-direction: row;
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,86 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types'
3
+ import type { Intent, Size, Variant } from './@types/button.js'
4
+
5
+ interface Props extends HTMLAttributes<'button'>, Omit<HTMLAttributes<'a'>, 'type'> {
6
+ variant?: Variant
7
+ size?: Size
8
+ type?: 'submit' | 'reset' | 'button'
9
+ intent?: Intent
10
+ fullWidth?: boolean
11
+ ripple?: boolean
12
+ class?: string
13
+ as?: 'button' | 'a'
14
+ href?: string
15
+ }
16
+
17
+ // import Ripple from 'material-ripple-effects' // Commented out as this is React specific
18
+ import styles from './button.module.css'
19
+
20
+ const {
21
+ variant = 'filled',
22
+ size = 'md',
23
+ type = 'button',
24
+ intent = 'primary',
25
+ fullWidth = false,
26
+ ripple = true,
27
+ class: className,
28
+ as = 'button',
29
+ href,
30
+ target = href?.startsWith('http') ? '_blank' : undefined,
31
+ ...rest
32
+ } = Astro.props as Props
33
+
34
+ const componentType = href ? 'a' : as
35
+
36
+ // let onMouseDown: (e: MouseEvent) => void | undefined
37
+ // if (ripple === true) {
38
+ // const rippleEffect = new Ripple()
39
+ // onMouseDown = (e: MouseEvent) => {
40
+ // rippleEffect.create(e, variant === 'filled' || variant === 'gradient' ? 'light' : 'dark')
41
+ // }
42
+ // }
43
+ ---
44
+
45
+ {
46
+ componentType === 'button' ? (
47
+ <button
48
+ type={type}
49
+ class:list={[
50
+ 'button',
51
+ variant,
52
+ size,
53
+ intent,
54
+ styles.button,
55
+ styles[variant],
56
+ styles[size],
57
+ styles[intent],
58
+ { [styles.fullWidth]: fullWidth },
59
+ className
60
+ ]}
61
+ {...rest}
62
+ >
63
+ <slot />
64
+ </button>
65
+ ) : (
66
+ <a
67
+ href={href}
68
+ target={target}
69
+ class:list={[
70
+ 'button',
71
+ variant,
72
+ size,
73
+ intent,
74
+ styles.button,
75
+ styles[variant],
76
+ styles[size],
77
+ styles[intent],
78
+ { [styles.fullWidth]: fullWidth },
79
+ className
80
+ ]}
81
+ {...rest}
82
+ >
83
+ <slot />
84
+ </a>
85
+ )
86
+ }