@stackoverflow/stacks 0.76.0 → 1.0.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.
Files changed (77) hide show
  1. package/LICENSE.MD +9 -9
  2. package/README.md +0 -0
  3. package/dist/controllers/index.d.ts +7 -7
  4. package/dist/controllers/s-expandable-control.d.ts +17 -17
  5. package/dist/controllers/s-modal.d.ts +97 -97
  6. package/dist/controllers/s-navigation-tablist.d.ts +36 -36
  7. package/dist/controllers/s-popover.d.ts +155 -155
  8. package/dist/controllers/s-table.d.ts +8 -8
  9. package/dist/controllers/s-tooltip.d.ts +82 -82
  10. package/dist/controllers/s-uploader.d.ts +48 -48
  11. package/dist/css/stacks.css +4354 -2560
  12. package/dist/css/stacks.min.css +1 -1
  13. package/dist/index.d.ts +3 -3
  14. package/dist/js/stacks.js +1978 -1978
  15. package/dist/js/stacks.min.js +1 -1
  16. package/dist/stacks.d.ts +21 -21
  17. package/lib/css/atomic/{_stacks-borders.less → borders.less} +30 -30
  18. package/lib/css/atomic/{_stacks-colors.less → colors.less} +0 -0
  19. package/lib/css/atomic/{_stacks-flex.less → flex.less} +14 -13
  20. package/lib/css/atomic/{_stacks-grid.less → grid.less} +11 -11
  21. package/lib/css/atomic/{_stacks-misc.less → misc.less} +22 -22
  22. package/lib/css/atomic/spacing.less +332 -0
  23. package/lib/css/atomic/{_stacks-typography.less → typography.less} +29 -29
  24. package/lib/css/atomic/width-height.less +194 -0
  25. package/lib/css/base/{_stacks-body.less → body.less} +2 -2
  26. package/lib/css/base/{_stacks-configuration-static.less → configuration-static.less} +3 -1
  27. package/lib/css/base/{_stacks-icons.less → icons.less} +0 -0
  28. package/lib/css/base/{_stacks-internals.less → internals.less} +0 -0
  29. package/lib/css/base/{_stacks-reset-meyer.less → reset-meyer.less} +0 -0
  30. package/lib/css/base/{_stacks-reset-normalize.less → reset-normalize.less} +0 -0
  31. package/lib/css/base/{_stacks-reset.less → reset.less} +2 -2
  32. package/lib/css/components/{_stacks-activity-indicator.less → activity-indicator.less} +9 -9
  33. package/lib/css/components/{_stacks-avatars.less → avatars.less} +40 -40
  34. package/lib/css/components/{_stacks-badges.less → badges.less} +11 -11
  35. package/lib/css/components/{_stacks-banners.less → banners.less} +5 -5
  36. package/lib/css/components/{_stacks-blank-states.less → blank-states.less} +2 -2
  37. package/lib/css/components/{_stacks-breadcrumbs.less → breadcrumbs.less} +7 -7
  38. package/lib/css/components/{_stacks-button-groups.less → button-groups.less} +2 -2
  39. package/lib/css/components/{_stacks-buttons.less → buttons.less} +46 -39
  40. package/lib/css/components/{_stacks-cards.less → cards.less} +2 -2
  41. package/lib/css/components/{_stacks-code-blocks.less → code-blocks.less} +8 -8
  42. package/lib/css/components/{_stacks-collapsible.less → collapsible.less} +0 -0
  43. package/lib/css/components/{_stacks-inputs.less → inputs.less} +41 -41
  44. package/lib/css/components/{_stacks-link-previews.less → link-previews.less} +17 -17
  45. package/lib/css/components/{_stacks-links.less → links.less} +4 -4
  46. package/lib/css/components/{_stacks-menu.less → menu.less} +5 -5
  47. package/lib/css/components/{_stacks-modals.less → modals.less} +20 -20
  48. package/lib/css/components/{_stacks-navigation.less → navigation.less} +12 -12
  49. package/lib/css/components/{_stacks-notices.less → notices.less} +12 -12
  50. package/lib/css/components/{_stacks-page-titles.less → page-titles.less} +9 -9
  51. package/lib/css/components/{_stacks-pagination.less → pagination.less} +8 -8
  52. package/lib/css/components/{_stacks-popovers.less → popovers.less} +17 -17
  53. package/lib/css/components/{_stacks-post-summary.less → post-summary.less} +35 -35
  54. package/lib/css/components/{_stacks-progress-bars.less → progress-bars.less} +29 -30
  55. package/lib/css/components/{_stacks-prose.less → prose.less} +31 -31
  56. package/lib/css/components/{_stacks-spinner.less → spinner.less} +14 -14
  57. package/lib/css/components/{_stacks-tables.less → tables.less} +10 -10
  58. package/lib/css/components/{_stacks-tags.less → tags.less} +24 -24
  59. package/lib/css/components/{_stacks-toggle-switches.less → toggle-switches.less} +5 -5
  60. package/lib/css/components/{_stacks-topbar.less → topbar.less} +22 -20
  61. package/lib/css/components/{_stacks-uploader.less → uploader.less} +18 -18
  62. package/lib/css/components/{_stacks-user-cards.less → user-cards.less} +14 -14
  63. package/lib/css/components/{_stacks-widget-dynamic.less → widget-dynamic.less} +1 -1
  64. package/lib/css/components/{_stacks-widget-static.less → widget-static.less} +39 -38
  65. package/lib/css/exports/{_stacks-constants-colors.less → constants-colors.less} +9 -29
  66. package/lib/css/exports/constants-helpers.less +108 -0
  67. package/lib/css/exports/constants-type.less +153 -0
  68. package/lib/css/exports/{_stacks-exports.less → exports.less} +4 -4
  69. package/lib/css/exports/{_stacks-mixins.less → mixins.less} +18 -1
  70. package/lib/css/stacks-dynamic.less +12 -12
  71. package/lib/css/stacks-static.less +38 -38
  72. package/lib/css/stacks.less +13 -13
  73. package/package.json +9 -9
  74. package/lib/css/atomic/_stacks-spacing.less +0 -168
  75. package/lib/css/atomic/_stacks-width-height.less +0 -195
  76. package/lib/css/exports/_stacks-constants-helpers.less +0 -139
  77. package/lib/css/exports/_stacks-constants-type.less +0 -152
@@ -1,8 +1,8 @@
1
- import * as Stacks from "../stacks";
2
- export declare class TableController extends Stacks.StacksController {
3
- static targets: string[];
4
- readonly columnTarget: Element;
5
- readonly columnTargets: Element[];
6
- setCurrentSort(headElem: Element, direction: "asc" | "desc" | "none"): void;
7
- sort(evt: Event): void;
8
- }
1
+ import * as Stacks from "../stacks";
2
+ export declare class TableController extends Stacks.StacksController {
3
+ static targets: string[];
4
+ readonly columnTarget: Element;
5
+ readonly columnTargets: Element[];
6
+ setCurrentSort(headElem: Element, direction: "asc" | "desc" | "none"): void;
7
+ sort(evt: Event): void;
8
+ }
@@ -1,82 +1,82 @@
1
- import { BasePopoverController } from "./s-popover";
2
- export interface TooltipOptions {
3
- placement: string;
4
- }
5
- export declare class TooltipController extends BasePopoverController {
6
- static targets: never[];
7
- protected popoverSelectorAttribute: string;
8
- private boundScheduleShow;
9
- private boundHide;
10
- private boundHideIfWithin;
11
- private activeTimeout;
12
- /**
13
- * Binds mouseover and mouseout events in addition to BasePopoverController.connect
14
- */
15
- connect(): void;
16
- /**
17
- * Unbinds mouse events in addition to BasePopoverController.disconnect
18
- */
19
- disconnect(): void;
20
- /**
21
- * Attempts to show the tooltip popover so long as no other Stacks-managed popover is
22
- * present on the page.
23
- */
24
- show(dispatcher?: Event | Element | null): void;
25
- /**
26
- * Sets up a tooltip popover show after a delay.
27
- */
28
- scheduleShow(dispatcher?: Event | Element | null): void;
29
- /**
30
- * Cancels the scheduled tooltip popover display and hides it if already displayed
31
- */
32
- hide(dispatcher?: Event | Element | null): void;
33
- /**
34
- * Applies data-s-tooltip-html-title and title attributes.
35
- */
36
- applyTitleAttributes(): HTMLElement | null;
37
- /**
38
- * Automatically hides the tooltip popover when a Stacks popover is shown anywhere on
39
- * the page.
40
- */
41
- protected bindDocumentEvents(): void;
42
- /**
43
- * Unbinds all mouse events
44
- */
45
- protected unbindDocumentEvents(): void;
46
- /**
47
- * Attempts to generate a new tooltip popover from the title attribute if no popover
48
- * was present when requested, otherwise throws an error.
49
- */
50
- protected generatePopover(): HTMLElement | null;
51
- /**
52
- * Hides the tooltip if is or is within the event's target.
53
- * @param event An event object from s-popover:shown
54
- */
55
- private hideIfWithin;
56
- /**
57
- * Binds mouse events to show/hide on reference element hover
58
- */
59
- private bindMouseEvents;
60
- /**
61
- * Unbinds all mouse events
62
- */
63
- private unbindMouseEvents;
64
- /**
65
- * Generates an ID for tooltips created with setTooltip.
66
- */
67
- private static generateId;
68
- }
69
- /**
70
- * Adds or updates a Stacks tooltip on a given element, initializing the controller if necessary
71
- * @param element The element to add a tooltip to.
72
- * @param html An HTML string to populate the tooltip with.
73
- * @param options Options for rendering the tooltip.
74
- */
75
- export declare function setTooltipHtml(element: Element, html: string, options?: TooltipOptions): void;
76
- /**
77
- * Adds or updates a Stacks tooltip on a given element, initializing the controller if necessary
78
- * @param element The element to add a tooltip to.
79
- * @param text A plain text string to populate the tooltip with.
80
- * @param options Options for rendering the tooltip.
81
- */
82
- export declare function setTooltipText(element: Element, text: string, options?: TooltipOptions): void;
1
+ import { BasePopoverController } from "./s-popover";
2
+ export interface TooltipOptions {
3
+ placement: string;
4
+ }
5
+ export declare class TooltipController extends BasePopoverController {
6
+ static targets: never[];
7
+ protected popoverSelectorAttribute: string;
8
+ private boundScheduleShow;
9
+ private boundHide;
10
+ private boundHideIfWithin;
11
+ private activeTimeout;
12
+ /**
13
+ * Binds mouseover and mouseout events in addition to BasePopoverController.connect
14
+ */
15
+ connect(): void;
16
+ /**
17
+ * Unbinds mouse events in addition to BasePopoverController.disconnect
18
+ */
19
+ disconnect(): void;
20
+ /**
21
+ * Attempts to show the tooltip popover so long as no other Stacks-managed popover is
22
+ * present on the page.
23
+ */
24
+ show(dispatcher?: Event | Element | null): void;
25
+ /**
26
+ * Sets up a tooltip popover show after a delay.
27
+ */
28
+ scheduleShow(dispatcher?: Event | Element | null): void;
29
+ /**
30
+ * Cancels the scheduled tooltip popover display and hides it if already displayed
31
+ */
32
+ hide(dispatcher?: Event | Element | null): void;
33
+ /**
34
+ * Applies data-s-tooltip-html-title and title attributes.
35
+ */
36
+ applyTitleAttributes(): HTMLElement | null;
37
+ /**
38
+ * Automatically hides the tooltip popover when a Stacks popover is shown anywhere on
39
+ * the page.
40
+ */
41
+ protected bindDocumentEvents(): void;
42
+ /**
43
+ * Unbinds all mouse events
44
+ */
45
+ protected unbindDocumentEvents(): void;
46
+ /**
47
+ * Attempts to generate a new tooltip popover from the title attribute if no popover
48
+ * was present when requested, otherwise throws an error.
49
+ */
50
+ protected generatePopover(): HTMLElement | null;
51
+ /**
52
+ * Hides the tooltip if is or is within the event's target.
53
+ * @param event An event object from s-popover:shown
54
+ */
55
+ private hideIfWithin;
56
+ /**
57
+ * Binds mouse events to show/hide on reference element hover
58
+ */
59
+ private bindMouseEvents;
60
+ /**
61
+ * Unbinds all mouse events
62
+ */
63
+ private unbindMouseEvents;
64
+ /**
65
+ * Generates an ID for tooltips created with setTooltip.
66
+ */
67
+ private static generateId;
68
+ }
69
+ /**
70
+ * Adds or updates a Stacks tooltip on a given element, initializing the controller if necessary
71
+ * @param element The element to add a tooltip to.
72
+ * @param html An HTML string to populate the tooltip with.
73
+ * @param options Options for rendering the tooltip.
74
+ */
75
+ export declare function setTooltipHtml(element: Element, html: string, options?: TooltipOptions): void;
76
+ /**
77
+ * Adds or updates a Stacks tooltip on a given element, initializing the controller if necessary
78
+ * @param element The element to add a tooltip to.
79
+ * @param text A plain text string to populate the tooltip with.
80
+ * @param options Options for rendering the tooltip.
81
+ */
82
+ export declare function setTooltipText(element: Element, text: string, options?: TooltipOptions): void;
@@ -1,48 +1,48 @@
1
- import * as Stacks from "../stacks";
2
- export declare class UploaderController extends Stacks.StacksController {
3
- static targets: string[];
4
- private inputTarget;
5
- private previewsTarget;
6
- private uploaderTarget;
7
- private boundDragEnter;
8
- private boundDragLeave;
9
- private static readonly FILE_DISPLAY_LIMIT;
10
- private static readonly MAX_FILE_SIZE;
11
- connect(): void;
12
- disconnect(): void;
13
- /**
14
- * Handles rendering the file preview state on input change
15
- */
16
- handleInput(): void;
17
- /**
18
- * Resets the Uploader to initial state
19
- */
20
- reset(): void;
21
- /**
22
- * Set hide/show and disabled state on elements depending on preview state
23
- * @param {boolean} shouldPreview - Uploader is entering a preview state
24
- */
25
- private handleVisible;
26
- /**
27
- * Adds a DOM element to preview a selected file
28
- * @param {FilePreview} file
29
- */
30
- private addFilePreview;
31
- /**
32
- * Toggles display and disabled state for select elements on valid input
33
- * @param {boolean} active - Uploader is in active state (typically on 'dragenter')
34
- */
35
- private handleUploaderActive;
36
- /**
37
- * Converts the file data into a data URL
38
- * @param {File} file
39
- * @returns an object containing a FilePreview object
40
- */
41
- private fileToDataURL;
42
- /**
43
- * Gets an array of FilePreviews from a FileList
44
- * @param {FileList|[]} files
45
- * @returns an array of FilePreview objects from a FileList
46
- */
47
- private getDataURLs;
48
- }
1
+ import * as Stacks from "../stacks";
2
+ export declare class UploaderController extends Stacks.StacksController {
3
+ static targets: string[];
4
+ private inputTarget;
5
+ private previewsTarget;
6
+ private uploaderTarget;
7
+ private boundDragEnter;
8
+ private boundDragLeave;
9
+ private static readonly FILE_DISPLAY_LIMIT;
10
+ private static readonly MAX_FILE_SIZE;
11
+ connect(): void;
12
+ disconnect(): void;
13
+ /**
14
+ * Handles rendering the file preview state on input change
15
+ */
16
+ handleInput(): void;
17
+ /**
18
+ * Resets the Uploader to initial state
19
+ */
20
+ reset(): void;
21
+ /**
22
+ * Set hide/show and disabled state on elements depending on preview state
23
+ * @param {boolean} shouldPreview - Uploader is entering a preview state
24
+ */
25
+ private handleVisible;
26
+ /**
27
+ * Adds a DOM element to preview a selected file
28
+ * @param {FilePreview} file
29
+ */
30
+ private addFilePreview;
31
+ /**
32
+ * Toggles display and disabled state for select elements on valid input
33
+ * @param {boolean} active - Uploader is in active state (typically on 'dragenter')
34
+ */
35
+ private handleUploaderActive;
36
+ /**
37
+ * Converts the file data into a data URL
38
+ * @param {File} file
39
+ * @returns an object containing a FilePreview object
40
+ */
41
+ private fileToDataURL;
42
+ /**
43
+ * Gets an array of FilePreviews from a FileList
44
+ * @param {FileList|[]} files
45
+ * @returns an array of FilePreview objects from a FileList
46
+ */
47
+ private getDataURLs;
48
+ }