@inglorious/ui 6.0.0 → 7.0.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 (39) hide show
  1. package/package.json +32 -12
  2. package/src/controls/controls.css +3 -1
  3. package/src/controls/file-upload/file-upload.stories.js +93 -0
  4. package/src/controls/file-upload/index.js +3 -0
  5. package/src/controls/file-upload/style.css +99 -0
  6. package/src/controls/file-upload/template.js +100 -0
  7. package/src/controls/input/input.stories.js +110 -3
  8. package/src/controls/textarea/index.js +3 -0
  9. package/src/controls/textarea/style.css +98 -0
  10. package/src/controls/textarea/template.js +94 -0
  11. package/src/controls/textarea/textarea.stories.js +158 -0
  12. package/src/data-display/before-after/before-after.stories.js +74 -0
  13. package/src/data-display/before-after/handlers.js +44 -0
  14. package/src/data-display/before-after/helpers.js +4 -0
  15. package/src/data-display/before-after/index.js +17 -0
  16. package/src/data-display/before-after/style.css +128 -0
  17. package/src/data-display/before-after/template.js +225 -0
  18. package/src/data-display/carousel/carousel.stories.js +166 -0
  19. package/src/data-display/carousel/handlers.js +78 -0
  20. package/src/data-display/carousel/helpers.js +54 -0
  21. package/src/data-display/carousel/index.js +17 -0
  22. package/src/data-display/carousel/style.css +233 -0
  23. package/src/data-display/carousel/template.js +655 -0
  24. package/src/data-display/data-display.css +2 -0
  25. package/src/examples/dashboard/app-drawer.js +12 -0
  26. package/src/examples/dashboard/before-after-data.js +29 -0
  27. package/src/examples/dashboard/primitive-content.js +220 -33
  28. package/src/index.js +4 -0
  29. package/src/layout/flex/flex.stories.js +49 -0
  30. package/src/layout/flex/style.css +59 -0
  31. package/src/layout/flex/template.js +2 -0
  32. package/types/controls/file-upload.d.ts +27 -0
  33. package/types/controls/input.d.ts +6 -0
  34. package/types/controls/textarea.d.ts +29 -0
  35. package/types/controls/upload-field.d.ts +27 -0
  36. package/types/data-display/before-after.d.ts +39 -0
  37. package/types/data-display/carousel.d.ts +72 -0
  38. package/types/index.d.ts +2 -0
  39. package/types/layout/flex.d.ts +1 -0
@@ -0,0 +1,72 @@
1
+ import type { TemplateResult, Api } from "@inglorious/web"
2
+
3
+ export type CarouselAxis = "x" | "y"
4
+ export type CarouselGap = "none" | "sm" | "md" | "lg" | "xl"
5
+ export type CarouselAlign = "stretch" | "start" | "center" | "end"
6
+ export type CarouselDirection = "previous" | "next"
7
+ export type CarouselArrowPlacement = "inside" | "outside"
8
+ export type CarouselArrowVariant = "default" | "outline" | "ghost"
9
+ export type CarouselArrowColor =
10
+ | "primary"
11
+ | "secondary"
12
+ | "success"
13
+ | "warning"
14
+ | "error"
15
+ | "info"
16
+
17
+ export interface CarouselProps {
18
+ id?: string
19
+ type?: string
20
+ label?: string
21
+
22
+ items?: unknown[]
23
+ /** Index of the item the viewport has settled on. */
24
+ page?: number
25
+ /** How many items are rotated off the front (infinite carousels only). */
26
+ rotation?: number
27
+
28
+ /** Wrap past the ends by rotating the items instead of stopping. */
29
+ isInfinite?: boolean
30
+
31
+ axis?: CarouselAxis
32
+ gap?: CarouselGap
33
+ align?: CarouselAlign
34
+
35
+ /** Whether the arrows float over the slides or sit beside them. */
36
+ arrowPlacement?: CarouselArrowPlacement
37
+ /** Button variant used for the arrows. */
38
+ arrowVariant?: CarouselArrowVariant
39
+ /** Button color used for the arrows. */
40
+ arrowColor?: CarouselArrowColor
41
+
42
+ hasArrows?: boolean
43
+ hasIndicators?: boolean
44
+ isFullWidth?: boolean
45
+
46
+ onPageChange?: (page: number) => void
47
+ [key: string]: unknown
48
+ }
49
+
50
+ export interface CarouselType {
51
+ create(entity: CarouselProps): void
52
+ indicatorSelect(
53
+ props: CarouselProps,
54
+ index: number,
55
+ viewport: HTMLElement | null | undefined,
56
+ ): void
57
+ pageChange(entity: CarouselProps, page: number): void
58
+ rotate(entity: CarouselProps, step: number): void
59
+
60
+ render(entity: CarouselProps, api: Api): TemplateResult
61
+ renderCarousel(props: CarouselProps): TemplateResult
62
+ renderViewport(props: CarouselProps): TemplateResult
63
+ renderItem(props: CarouselProps, item: unknown, index: number): TemplateResult
64
+ renderArrow(
65
+ props: CarouselProps,
66
+ direction: CarouselDirection,
67
+ ): TemplateResult
68
+ renderIndicators(props: CarouselProps): TemplateResult
69
+ renderIndicator(props: CarouselProps, index: number): TemplateResult
70
+ }
71
+
72
+ export declare const Carousel: CarouselType
package/types/index.d.ts CHANGED
@@ -18,6 +18,8 @@ export type { RatingProps, RatingType } from "./controls/rating"
18
18
  export type { SelectProps, SelectType, SelectOption } from "./controls/select"
19
19
  export type { SliderProps, SliderType } from "./controls/slider"
20
20
  export type { SwitchProps, SwitchType } from "./controls/switch"
21
+ export type { TextareaProps, TextareaType } from "./controls/textarea"
22
+ export type { FileUploadProps, FileUploadType } from "./controls/file-upload"
21
23
  export type { ContainerProps, ContainerType } from "./layout/container"
22
24
  export type { FlexProps, FlexType } from "./layout/flex"
23
25
  export type { GridProps, GridType } from "./layout/grid"
@@ -18,6 +18,7 @@ export interface FlexProps {
18
18
  align?: "stretch" | "start" | "center" | "end" | "baseline"
19
19
  gap?: "none" | "sm" | "md" | "lg" | "xl"
20
20
  padding?: "none" | "sm" | "md" | "lg" | "xl"
21
+ overflow?: "visible" | "hidden" | "clip" | "scroll" | "auto"
21
22
  isInline?: boolean
22
23
  isFullWidth?: boolean
23
24
  children?: Array<TemplateResult | string | number>