@ukic/react 2.0.0-alpha.121

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Ionic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,50 @@
1
+ /// <reference types="react" />
2
+ import type { JSX } from '@ukic/web-components';
3
+ export declare const IcAlert: import("react").ForwardRefExoticComponent<JSX.IcAlert & Omit<import("react").HTMLAttributes<HTMLIcAlertElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcAlertElement>>;
4
+ export declare const IcBackToTop: import("react").ForwardRefExoticComponent<JSX.IcBackToTop & Omit<import("react").HTMLAttributes<HTMLIcBackToTopElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcBackToTopElement>>;
5
+ export declare const IcBreadcrumb: import("react").ForwardRefExoticComponent<JSX.IcBreadcrumb & Omit<import("react").HTMLAttributes<HTMLIcBreadcrumbElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcBreadcrumbElement>>;
6
+ export declare const IcBreadcrumbs: import("react").ForwardRefExoticComponent<JSX.IcBreadcrumbs & Omit<import("react").HTMLAttributes<HTMLIcBreadcrumbsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcBreadcrumbsElement>>;
7
+ export declare const IcButton: import("react").ForwardRefExoticComponent<JSX.IcButton & Omit<import("react").HTMLAttributes<HTMLIcButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcButtonElement>>;
8
+ export declare const IcCard: import("react").ForwardRefExoticComponent<JSX.IcCard & Omit<import("react").HTMLAttributes<HTMLIcCardElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcCardElement>>;
9
+ export declare const IcCheckbox: import("react").ForwardRefExoticComponent<JSX.IcCheckbox & Omit<import("react").HTMLAttributes<HTMLIcCheckboxElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcCheckboxElement>>;
10
+ export declare const IcCheckboxGroup: import("react").ForwardRefExoticComponent<JSX.IcCheckboxGroup & Omit<import("react").HTMLAttributes<HTMLIcCheckboxGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcCheckboxGroupElement>>;
11
+ export declare const IcClassificationBanner: import("react").ForwardRefExoticComponent<JSX.IcClassificationBanner & Omit<import("react").HTMLAttributes<HTMLIcClassificationBannerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcClassificationBannerElement>>;
12
+ export declare const IcDataEntity: import("react").ForwardRefExoticComponent<JSX.IcDataEntity & Omit<import("react").HTMLAttributes<HTMLIcDataEntityElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcDataEntityElement>>;
13
+ export declare const IcDataRow: import("react").ForwardRefExoticComponent<JSX.IcDataRow & Omit<import("react").HTMLAttributes<HTMLIcDataRowElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcDataRowElement>>;
14
+ export declare const IcDivider: import("react").ForwardRefExoticComponent<JSX.IcDivider & Omit<import("react").HTMLAttributes<HTMLIcDividerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcDividerElement>>;
15
+ export declare const IcFooter: import("react").ForwardRefExoticComponent<JSX.IcFooter & Omit<import("react").HTMLAttributes<HTMLIcFooterElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcFooterElement>>;
16
+ export declare const IcFooterLink: import("react").ForwardRefExoticComponent<JSX.IcFooterLink & Omit<import("react").HTMLAttributes<HTMLIcFooterLinkElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcFooterLinkElement>>;
17
+ export declare const IcFooterLinkGroup: import("react").ForwardRefExoticComponent<JSX.IcFooterLinkGroup & Omit<import("react").HTMLAttributes<HTMLIcFooterLinkGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcFooterLinkGroupElement>>;
18
+ export declare const IcHero: import("react").ForwardRefExoticComponent<JSX.IcHero & Omit<import("react").HTMLAttributes<HTMLIcHeroElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcHeroElement>>;
19
+ export declare const IcInputComponentContainer: import("react").ForwardRefExoticComponent<JSX.IcInputComponentContainer & Omit<import("react").HTMLAttributes<HTMLIcInputComponentContainerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcInputComponentContainerElement>>;
20
+ export declare const IcInputContainer: import("react").ForwardRefExoticComponent<JSX.IcInputContainer & Omit<import("react").HTMLAttributes<HTMLIcInputContainerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcInputContainerElement>>;
21
+ export declare const IcInputLabel: import("react").ForwardRefExoticComponent<JSX.IcInputLabel & Omit<import("react").HTMLAttributes<HTMLIcInputLabelElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcInputLabelElement>>;
22
+ export declare const IcInputValidation: import("react").ForwardRefExoticComponent<JSX.IcInputValidation & Omit<import("react").HTMLAttributes<HTMLIcInputValidationElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcInputValidationElement>>;
23
+ export declare const IcLink: import("react").ForwardRefExoticComponent<JSX.IcLink & Omit<import("react").HTMLAttributes<HTMLIcLinkElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcLinkElement>>;
24
+ export declare const IcLoadingIndicator: import("react").ForwardRefExoticComponent<JSX.IcLoadingIndicator & Omit<import("react").HTMLAttributes<HTMLIcLoadingIndicatorElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcLoadingIndicatorElement>>;
25
+ export declare const IcMenu: import("react").ForwardRefExoticComponent<JSX.IcMenu & Omit<import("react").HTMLAttributes<HTMLIcMenuElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcMenuElement>>;
26
+ export declare const IcNavigationButton: import("react").ForwardRefExoticComponent<JSX.IcNavigationButton & Omit<import("react").HTMLAttributes<HTMLIcNavigationButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcNavigationButtonElement>>;
27
+ export declare const IcNavigationGroup: import("react").ForwardRefExoticComponent<JSX.IcNavigationGroup & Omit<import("react").HTMLAttributes<HTMLIcNavigationGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcNavigationGroupElement>>;
28
+ export declare const IcNavigationItem: import("react").ForwardRefExoticComponent<JSX.IcNavigationItem & Omit<import("react").HTMLAttributes<HTMLIcNavigationItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcNavigationItemElement>>;
29
+ export declare const IcNavigationMenu: import("react").ForwardRefExoticComponent<JSX.IcNavigationMenu & Omit<import("react").HTMLAttributes<HTMLIcNavigationMenuElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcNavigationMenuElement>>;
30
+ export declare const IcPageHeader: import("react").ForwardRefExoticComponent<JSX.IcPageHeader & Omit<import("react").HTMLAttributes<HTMLIcPageHeaderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcPageHeaderElement>>;
31
+ export declare const IcRadioGroup: import("react").ForwardRefExoticComponent<JSX.IcRadioGroup & Omit<import("react").HTMLAttributes<HTMLIcRadioGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcRadioGroupElement>>;
32
+ export declare const IcRadioOption: import("react").ForwardRefExoticComponent<JSX.IcRadioOption & Omit<import("react").HTMLAttributes<HTMLIcRadioOptionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcRadioOptionElement>>;
33
+ export declare const IcSearchBar: import("react").ForwardRefExoticComponent<JSX.IcSearchBar & Omit<import("react").HTMLAttributes<HTMLIcSearchBarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcSearchBarElement>>;
34
+ export declare const IcSectionContainer: import("react").ForwardRefExoticComponent<JSX.IcSectionContainer & Omit<import("react").HTMLAttributes<HTMLIcSectionContainerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcSectionContainerElement>>;
35
+ export declare const IcSelect: import("react").ForwardRefExoticComponent<JSX.IcSelect & Omit<import("react").HTMLAttributes<HTMLIcSelectElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcSelectElement>>;
36
+ export declare const IcSideNavigation: import("react").ForwardRefExoticComponent<JSX.IcSideNavigation & Omit<import("react").HTMLAttributes<HTMLIcSideNavigationElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcSideNavigationElement>>;
37
+ export declare const IcSkeleton: import("react").ForwardRefExoticComponent<JSX.IcSkeleton & Omit<import("react").HTMLAttributes<HTMLIcSkeletonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcSkeletonElement>>;
38
+ export declare const IcStatusTag: import("react").ForwardRefExoticComponent<JSX.IcStatusTag & Omit<import("react").HTMLAttributes<HTMLIcStatusTagElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcStatusTagElement>>;
39
+ export declare const IcStep: import("react").ForwardRefExoticComponent<JSX.IcStep & Omit<import("react").HTMLAttributes<HTMLIcStepElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcStepElement>>;
40
+ export declare const IcStepper: import("react").ForwardRefExoticComponent<JSX.IcStepper & Omit<import("react").HTMLAttributes<HTMLIcStepperElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcStepperElement>>;
41
+ export declare const IcSwitch: import("react").ForwardRefExoticComponent<JSX.IcSwitch & Omit<import("react").HTMLAttributes<HTMLIcSwitchElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcSwitchElement>>;
42
+ export declare const IcTab: import("react").ForwardRefExoticComponent<JSX.IcTab & Omit<import("react").HTMLAttributes<HTMLIcTabElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTabElement>>;
43
+ export declare const IcTabContext: import("react").ForwardRefExoticComponent<JSX.IcTabContext & Omit<import("react").HTMLAttributes<HTMLIcTabContextElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTabContextElement>>;
44
+ export declare const IcTabList: import("react").ForwardRefExoticComponent<JSX.IcTabList & Omit<import("react").HTMLAttributes<HTMLIcTabListElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTabListElement>>;
45
+ export declare const IcTabPanel: import("react").ForwardRefExoticComponent<JSX.IcTabPanel & Omit<import("react").HTMLAttributes<HTMLIcTabPanelElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTabPanelElement>>;
46
+ export declare const IcTextField: import("react").ForwardRefExoticComponent<JSX.IcTextField & Omit<import("react").HTMLAttributes<HTMLIcTextFieldElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTextFieldElement>>;
47
+ export declare const IcTheme: import("react").ForwardRefExoticComponent<JSX.IcTheme & Omit<import("react").HTMLAttributes<HTMLIcThemeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcThemeElement>>;
48
+ export declare const IcTooltip: import("react").ForwardRefExoticComponent<JSX.IcTooltip & Omit<import("react").HTMLAttributes<HTMLIcTooltipElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTooltipElement>>;
49
+ export declare const IcTopNavigation: import("react").ForwardRefExoticComponent<JSX.IcTopNavigation & Omit<import("react").HTMLAttributes<HTMLIcTopNavigationElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTopNavigationElement>>;
50
+ export declare const IcTypography: import("react").ForwardRefExoticComponent<JSX.IcTypography & Omit<import("react").HTMLAttributes<HTMLIcTypographyElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTypographyElement>>;
@@ -0,0 +1,54 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ /* auto-generated react proxies */
4
+ import { createReactComponent } from './react-component-lib';
5
+ import { defineCustomElements } from '@ukic/web-components/loader';
6
+ defineCustomElements();
7
+ export const IcAlert = /*@__PURE__*/ createReactComponent('ic-alert');
8
+ export const IcBackToTop = /*@__PURE__*/ createReactComponent('ic-back-to-top');
9
+ export const IcBreadcrumb = /*@__PURE__*/ createReactComponent('ic-breadcrumb');
10
+ export const IcBreadcrumbs = /*@__PURE__*/ createReactComponent('ic-breadcrumbs');
11
+ export const IcButton = /*@__PURE__*/ createReactComponent('ic-button');
12
+ export const IcCard = /*@__PURE__*/ createReactComponent('ic-card');
13
+ export const IcCheckbox = /*@__PURE__*/ createReactComponent('ic-checkbox');
14
+ export const IcCheckboxGroup = /*@__PURE__*/ createReactComponent('ic-checkbox-group');
15
+ export const IcClassificationBanner = /*@__PURE__*/ createReactComponent('ic-classification-banner');
16
+ export const IcDataEntity = /*@__PURE__*/ createReactComponent('ic-data-entity');
17
+ export const IcDataRow = /*@__PURE__*/ createReactComponent('ic-data-row');
18
+ export const IcDivider = /*@__PURE__*/ createReactComponent('ic-divider');
19
+ export const IcFooter = /*@__PURE__*/ createReactComponent('ic-footer');
20
+ export const IcFooterLink = /*@__PURE__*/ createReactComponent('ic-footer-link');
21
+ export const IcFooterLinkGroup = /*@__PURE__*/ createReactComponent('ic-footer-link-group');
22
+ export const IcHero = /*@__PURE__*/ createReactComponent('ic-hero');
23
+ export const IcInputComponentContainer = /*@__PURE__*/ createReactComponent('ic-input-component-container');
24
+ export const IcInputContainer = /*@__PURE__*/ createReactComponent('ic-input-container');
25
+ export const IcInputLabel = /*@__PURE__*/ createReactComponent('ic-input-label');
26
+ export const IcInputValidation = /*@__PURE__*/ createReactComponent('ic-input-validation');
27
+ export const IcLink = /*@__PURE__*/ createReactComponent('ic-link');
28
+ export const IcLoadingIndicator = /*@__PURE__*/ createReactComponent('ic-loading-indicator');
29
+ export const IcMenu = /*@__PURE__*/ createReactComponent('ic-menu');
30
+ export const IcNavigationButton = /*@__PURE__*/ createReactComponent('ic-navigation-button');
31
+ export const IcNavigationGroup = /*@__PURE__*/ createReactComponent('ic-navigation-group');
32
+ export const IcNavigationItem = /*@__PURE__*/ createReactComponent('ic-navigation-item');
33
+ export const IcNavigationMenu = /*@__PURE__*/ createReactComponent('ic-navigation-menu');
34
+ export const IcPageHeader = /*@__PURE__*/ createReactComponent('ic-page-header');
35
+ export const IcRadioGroup = /*@__PURE__*/ createReactComponent('ic-radio-group');
36
+ export const IcRadioOption = /*@__PURE__*/ createReactComponent('ic-radio-option');
37
+ export const IcSearchBar = /*@__PURE__*/ createReactComponent('ic-search-bar');
38
+ export const IcSectionContainer = /*@__PURE__*/ createReactComponent('ic-section-container');
39
+ export const IcSelect = /*@__PURE__*/ createReactComponent('ic-select');
40
+ export const IcSideNavigation = /*@__PURE__*/ createReactComponent('ic-side-navigation');
41
+ export const IcSkeleton = /*@__PURE__*/ createReactComponent('ic-skeleton');
42
+ export const IcStatusTag = /*@__PURE__*/ createReactComponent('ic-status-tag');
43
+ export const IcStep = /*@__PURE__*/ createReactComponent('ic-step');
44
+ export const IcStepper = /*@__PURE__*/ createReactComponent('ic-stepper');
45
+ export const IcSwitch = /*@__PURE__*/ createReactComponent('ic-switch');
46
+ export const IcTab = /*@__PURE__*/ createReactComponent('ic-tab');
47
+ export const IcTabContext = /*@__PURE__*/ createReactComponent('ic-tab-context');
48
+ export const IcTabList = /*@__PURE__*/ createReactComponent('ic-tab-list');
49
+ export const IcTabPanel = /*@__PURE__*/ createReactComponent('ic-tab-panel');
50
+ export const IcTextField = /*@__PURE__*/ createReactComponent('ic-text-field');
51
+ export const IcTheme = /*@__PURE__*/ createReactComponent('ic-theme');
52
+ export const IcTooltip = /*@__PURE__*/ createReactComponent('ic-tooltip');
53
+ export const IcTopNavigation = /*@__PURE__*/ createReactComponent('ic-top-navigation');
54
+ export const IcTypography = /*@__PURE__*/ createReactComponent('ic-typography');
@@ -0,0 +1,57 @@
1
+ /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}html{font-family:var(--ic-font-body-family);color:var(--ic-color-primary-text)}a.ic-card-wrapper-link{text-decoration:none;outline:none;color:currentcolor}:root{--ic-border-radius:2px;--ic-border-radius-inset:11px;--ic-border-focus:0 0 0 2px var(--ic-architectural-white),
2
+ 0 0 0 4px var(--ic-focus-blue), 0 0 0 8px var(--ic-focus-glow);--ic-border-focus-inset:inset 0 0 0 4px var(--ic-focus-glow),
3
+ inset 0 0 0 6px var(--ic-focus-blue),
4
+ inset 0 0 0 8px var(--ic-architectural-white);--ic-border-focus-dark:0 0 0 2px white, 0 0 0 5px rgba(255 255 255 / 52%);--ic-elevation-raised:0 0 2px rgb(0 0 0 / 50%);--ic-elevation-overlay:0 2px 8px rgb(0 0 0 / 20%);--ic-elevation-modal:0 4px 16px rgb(0 0 0 / 25%);--ic-elevation-inset:inset 0 4px 16px rgb(0 0 0 / 25%),
5
+ inset 0 -4px 16px rgb(0 0 0 / 25%);--ic-easing-transition-fast:var(--ic-transition-duration-fast)
6
+ cubic-bezier(0.165, 0.84, 0.44, 1);--ic-easing-transition-slow:var(--ic-transition-duration-slow)
7
+ cubic-bezier(0.165, 0.84, 0.44, 1);--ic-transition-duration-fast:100ms;--ic-transition-duration-slow:300ms;--ic-overlay-z-index:1000;--ic-border-disabled:1px dashed var(--ic-architectural-200);--ic-font-body-family:"Open Sans", "Helvetica Neue", "Arial", "sans-serif";--ic-font-heading-family:"Nunito Sans", sans-serif;--ic-font-weight-extrabold:800;--ic-font-weight-bold:700;--ic-font-weight-semibold:600;--ic-font-weight-regular:400;--ic-font-size-h1:2.625rem;--ic-font-size-h2:2.125rem;--ic-font-size-h3:1.5rem;--ic-font-size-h4:1.25rem;--ic-font-size-regular:1rem;--ic-font-size-label:0.875rem;--ic-font-size-caption:0.75rem;--ic-font-line-height-h1:4rem;--ic-font-line-height-h2:3.5rem;--ic-font-line-height-h3:2.5rem;--ic-font-line-height-h4:2rem;--ic-font-line-height-subtitle-large:1.5rem;--ic-font-line-height-subtitle-small:1.5rem;--ic-font-line-height-body:1.5rem;--ic-font-line-height-caption:1.25rem;--ic-font-line-height-code:1.5rem;--ic-font-letter-spacing-0pt025:0.025rem;--ic-font-letter-spacing-0pt005:0.005rem;--ic-font-letter-spacing-0pt0025:0.0025rem;--ic-font-letter-spacing-0pt0015:0.0015rem;--ic-font-h1:var(--ic-font-weight-extrabold) var(--ic-font-size-h1) /
8
+ var(--ic-font-line-height-h1) var(--ic-font-heading-family);--ic-font-h2:var(--ic-font-weight-bold) var(--ic-font-size-h2) /
9
+ var(--ic-font-line-height-h2) var(--ic-font-heading-family);--ic-font-h3:var(--ic-font-weight-regular) var(--ic-font-size-h3) /
10
+ var(--ic-font-line-height-h3) var(--ic-font-body-family);--ic-font-h4:var(--ic-font-weight-semibold) var(--ic-font-size-h4) /
11
+ var(--ic-font-line-height-h4) var(--ic-font-body-family);--ic-font-subtitle-large:var(--ic-font-weight-bold)
12
+ var(--ic-font-size-regular) / var(--ic-font-line-height-subtitle-large)
13
+ var(--ic-font-body-family);--ic-font-subtitle-small:var(--ic-font-weight-semibold)
14
+ var(--ic-font-size-label) / var(--ic-font-line-height-subtitle-small)
15
+ var(--ic-font-body-family);--ic-font-body:var(--ic-font-weight-regular) var(--ic-font-size-regular) /
16
+ var(--ic-font-line-height-body) var(--ic-font-body-family);--ic-font-caption:var(--ic-font-weight-semibold) var(--ic-font-size-caption) /
17
+ var(--ic-font-line-height-caption) var(--ic-font-body-family);--ic-font-label:var(--ic-font-weight-semibold) var(--ic-font-size-label) /
18
+ var(--ic-font-line-height-body) var(--ic-font-body-family);--ic-keyline-darken-rgb:rgb(0 0 0 / 20%);--ic-keyline-darken:1px solid var(--ic-keyline-darken-rgb);--ic-keyline-lighten-rgb:rgb(255 255 255 / 20%);--ic-keyline-lighten:1px solid var(--ic-keyline-lighten-rgb);--ic-status-error:#d4351c;--ic-status-error-background:#ffe4e3;--ic-status-warning:#ffc107;--ic-status-warning-background:#fffbd8;--ic-status-warning-mid:#d07932;--ic-status-warning-dark:#7a4c3c;--ic-status-success:#00703c;--ic-status-success-background:#e8fef3;--ic-status-info:#3170c2;--ic-status-info-background:#e1f0fc;--ic-status-error-contrast:#f15b4e;--ic-status-warning-contrast:#ffc107;--ic-status-success-contrast:#1bb56c;--ic-status-info-contrast:#488fe3;--ic-architectural-20:#f9fafa;--ic-architectural-40:#f4f4f5;--ic-architectural-60:#eeeff0;--ic-architectural-80:#e8e9eb;--ic-architectural-100:#e1e3e5;--ic-architectural-200:#c4c8cd;--ic-architectural-300:#a7acb3;--ic-architectural-400:#8a919b;--ic-architectural-500:#6c7580;--ic-architectural-600:#575e68;--ic-architectural-700:#41464d;--ic-architectural-800:#2c2f34;--ic-architectural-900:#0b0c0c;--ic-architectural-white:#fff;--ic-architectural-black:#000;--ic-color-primary-text:#0b0c0c;--ic-color-white-text:#fff;--ic-color-secondary-text:#41464d;--ic-color-tertiary-text:#6c7580;--ic-action-default:#1759bc;--ic-action-default-hover:#0b399c;--ic-action-default-active:#07277e;--ic-action-default-active-alpha:rgba(23 89 188 / 50%);--ic-action-default-bg-hover:rgb(23 89 188 / 10%);--ic-action-default-bg-active:rgb(23 89 188 / 20%);--ic-action-default-bg-hover-no-alpha:#e7eef8;--ic-action-default-bg-active-no-alpha:#d0def2;--ic-action-destructive:#d4351c;--ic-action-destructive-hover:#ad1e0e;--ic-action-destructive-active:#8b1209;--ic-action-light:#fff;--ic-action-light-hover:#c4c8cd;--ic-action-light-active:#a7acb3;--ic-action-light-bg-hover:rgb(255 255 255 / 10%);--ic-action-light-bg-active:rgb(255 255 255 / 20%);--ic-action-dark:#0b0c0c;--ic-action-dark-hover:#2c2f34;--ic-action-dark-active:#41464d;--ic-action-dark-bg-hover:rgb(65 70 77 / 10%);--ic-action-dark-bg-active:rgb(65 70 77 / 20%);--ic-classification-official:#2b71c7;--ic-classification-official-foreground:#fff;--ic-classification-secret:#f39c2c;--ic-classification-secret-foreground:#000;--ic-classification-top-secret:#a00;--ic-classification-top-secret-foreground:#fff;--ic-classification-not-set:#616161;--ic-classification-not-set-foreground:#fff;--ic-theme-blue-primary-r:27;--ic-theme-blue-primary-g:60;--ic-theme-blue-primary-b:121;--ic-theme-primary-r:var(--ic-theme-blue-primary-r);--ic-theme-primary-g:var(--ic-theme-blue-primary-g);--ic-theme-primary-b:var(--ic-theme-blue-primary-b);--ic-theme-primary:rgb(
19
+ var(--ic-theme-primary-r) var(--ic-theme-primary-g)
20
+ var(--ic-theme-primary-b)
21
+ );--ic-theme-secondary:rgb(
22
+ calc(var(--ic-theme-primary-r) * 0.8) calc(var(--ic-theme-primary-g) * 0.8)
23
+ calc(var(--ic-theme-primary-b) * 0.8)
24
+ );--ic-theme-tertiary:rgb(
25
+ calc(var(--ic-theme-primary-r) * 0.6) calc(var(--ic-theme-primary-g) * 0.6)
26
+ calc(var(--ic-theme-primary-b) * 0.6)
27
+ );--ic-theme-secondary-light:rgb(
28
+ calc(var(--ic-theme-primary-r) + ((255 - var(--ic-theme-primary-r)) * 0.2))
29
+ calc(
30
+ var(--ic-theme-primary-g) + ((255 - var(--ic-theme-primary-g)) * 0.2)
31
+ )
32
+ calc(
33
+ var(--ic-theme-primary-b) + ((255 - var(--ic-theme-primary-b)) * 0.2)
34
+ )
35
+ );--ic-theme-tertiary-light:rgb(
36
+ calc(var(--ic-theme-primary-r) + ((255 - var(--ic-theme-primary-r)) * 0.4))
37
+ calc(
38
+ var(--ic-theme-primary-g) + ((255 - var(--ic-theme-primary-g)) * 0.4)
39
+ )
40
+ calc(
41
+ var(--ic-theme-primary-b) + ((255 - var(--ic-theme-primary-b)) * 0.4)
42
+ )
43
+ );--ic-theme-primary-r-calc:calc(var(--ic-theme-primary-r) * 299);--ic-theme-primary-g-calc:calc(var(--ic-theme-primary-g) * 587);--ic-theme-primary-b-calc:calc(var(--ic-theme-primary-b) * 114);--ic-theme-primary-sum-calc:calc(
44
+ var(--ic-theme-primary-r-calc) + var(--ic-theme-primary-g-calc) +
45
+ var(--ic-theme-primary-b-calc)
46
+ );--ic-theme-primary-divide-calc:calc(var(--ic-theme-primary-sum-calc) / 1000);--ic-theme-primary-subtract-calc:calc(
47
+ var(--ic-theme-primary-divide-calc) - 128
48
+ );--ic-theme-primary-calc:calc(var(--ic-theme-primary-subtract-calc) * -1000);--ic-theme-calc:max(0, var(--ic-theme-primary-calc));--ic-theme-text:rgb(
49
+ calc(var(--ic-theme-calc) + 11) calc(var(--ic-theme-calc) + 12)
50
+ calc(var(--ic-theme-calc) + 12)
51
+ );--ic-theme-hover:rgb(
52
+ calc(var(--ic-theme-calc) + 65) calc(var(--ic-theme-calc) + 70)
53
+ calc(var(--ic-theme-calc) + 77) / 10%
54
+ );--ic-theme-active:rgb(
55
+ calc(var(--ic-theme-calc) + 65) calc(var(--ic-theme-calc) + 70)
56
+ calc(var(--ic-theme-calc) + 77) / 20%
57
+ );--ic-hyperlink:#1759bc;--ic-hyperlink-visited:#330072;--ic-hyperlink-hover:#7c2855;--ic-hyperlink-contrast:#5c98f2;--ic-hyperlink-contrast-visited:#bc75ff;--ic-hyperlink-contrast-hover:#db76ac;--ic-focus-blue:#0044d7;--ic-focus-glow:#80a1e8;--ic-breakpoint-xs:0;--ic-breakpoint-sm:576px;--ic-breakpoint-md:768px;--ic-breakpoint-lg:992px;--ic-breakpoint-xl:1200px;--ic-space-xxxs:0.125rem;--ic-space-xxs:0.25rem;--ic-space-xs:0.5rem;--ic-space-sm:0.75rem;--ic-space-md:1rem;--ic-space-lg:1.5rem;--ic-space-xl:2rem;--ic-space-xxl:3rem}
@@ -0,0 +1 @@
1
+ export * from './components';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface HTMLStencilElement extends HTMLElement {
3
+ componentOnReady(): Promise<this>;
4
+ }
5
+ interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
6
+ forwardedRef: React.RefObject<ElementType>;
7
+ ref?: React.Ref<any>;
8
+ }
9
+ export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType>, manipulatePropsFunction?: (originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<PropType & Omit<React.HTMLAttributes<ElementType>, "style"> & import("./interfaces").StyleReactProps> & React.RefAttributes<ElementType>>;
10
+ export {};
@@ -0,0 +1,59 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import { attachProps, createForwardRef, dashToPascalCase, defineCustomElement, isCoveredByReact, mergeRefs, } from './utils';
14
+ export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, customElement) => {
15
+ defineCustomElement(tagName, customElement);
16
+ const displayName = dashToPascalCase(tagName);
17
+ const ReactComponent = class extends React.Component {
18
+ constructor(props) {
19
+ super(props);
20
+ this.setComponentElRef = (element) => {
21
+ this.componentEl = element;
22
+ };
23
+ }
24
+ componentDidMount() {
25
+ this.componentDidUpdate(this.props);
26
+ }
27
+ componentDidUpdate(prevProps) {
28
+ attachProps(this.componentEl, this.props, prevProps);
29
+ }
30
+ render() {
31
+ const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
32
+ let propsToPass = Object.keys(cProps).reduce((acc, name) => {
33
+ if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
34
+ const eventName = name.substring(2).toLowerCase();
35
+ if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
36
+ acc[name] = cProps[name];
37
+ }
38
+ }
39
+ else {
40
+ acc[name] = cProps[name];
41
+ }
42
+ return acc;
43
+ }, {});
44
+ if (manipulatePropsFunction) {
45
+ propsToPass = manipulatePropsFunction(this.props, propsToPass);
46
+ }
47
+ const newProps = Object.assign(Object.assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style });
48
+ return React.createElement(tagName, newProps, children);
49
+ }
50
+ static get displayName() {
51
+ return displayName;
52
+ }
53
+ };
54
+ // If context was passed to createReactComponent then conditionally add it to the Component Class
55
+ if (ReactComponentContext) {
56
+ ReactComponent.contextType = ReactComponentContext;
57
+ }
58
+ return createForwardRef(ReactComponent, displayName);
59
+ };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { OverlayEventDetail } from './interfaces';
3
+ import { StencilReactForwardedRef } from './utils';
4
+ interface OverlayElement extends HTMLElement {
5
+ present: () => Promise<void>;
6
+ dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
7
+ }
8
+ export interface ReactOverlayProps {
9
+ children?: React.ReactNode;
10
+ isOpen: boolean;
11
+ onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
12
+ onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
13
+ onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
14
+ onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
15
+ }
16
+ export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(tagName: string, controller: {
17
+ create: (options: any) => Promise<OverlayType>;
18
+ }, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
19
+ forwardedRef?: StencilReactForwardedRef<OverlayType>;
20
+ }> & React.RefAttributes<OverlayType>>;
21
+ export {};
@@ -0,0 +1,108 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __rest = (this && this.__rest) || function (s, e) {
11
+ var t = {};
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
+ t[p] = s[p];
14
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
+ t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
20
+ };
21
+ import React from 'react';
22
+ import ReactDOM from 'react-dom';
23
+ import { attachProps, dashToPascalCase, defineCustomElement, setRef, } from './utils';
24
+ export const createOverlayComponent = (tagName, controller, customElement) => {
25
+ defineCustomElement(tagName, customElement);
26
+ const displayName = dashToPascalCase(tagName);
27
+ const didDismissEventName = `on${displayName}DidDismiss`;
28
+ const didPresentEventName = `on${displayName}DidPresent`;
29
+ const willDismissEventName = `on${displayName}WillDismiss`;
30
+ const willPresentEventName = `on${displayName}WillPresent`;
31
+ let isDismissing = false;
32
+ class Overlay extends React.Component {
33
+ constructor(props) {
34
+ super(props);
35
+ if (typeof document !== 'undefined') {
36
+ this.el = document.createElement('div');
37
+ }
38
+ this.handleDismiss = this.handleDismiss.bind(this);
39
+ }
40
+ static get displayName() {
41
+ return displayName;
42
+ }
43
+ componentDidMount() {
44
+ if (this.props.isOpen) {
45
+ this.present();
46
+ }
47
+ }
48
+ componentWillUnmount() {
49
+ if (this.overlay) {
50
+ this.overlay.dismiss();
51
+ }
52
+ }
53
+ handleDismiss(event) {
54
+ if (this.props.onDidDismiss) {
55
+ this.props.onDidDismiss(event);
56
+ }
57
+ setRef(this.props.forwardedRef, null);
58
+ }
59
+ shouldComponentUpdate(nextProps) {
60
+ // Check if the overlay component is about to dismiss
61
+ if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
62
+ isDismissing = true;
63
+ }
64
+ return true;
65
+ }
66
+ componentDidUpdate(prevProps) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ if (this.overlay) {
69
+ attachProps(this.overlay, this.props, prevProps);
70
+ }
71
+ if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
72
+ this.present(prevProps);
73
+ }
74
+ if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
75
+ yield this.overlay.dismiss();
76
+ isDismissing = false;
77
+ /**
78
+ * Now that the overlay is dismissed
79
+ * we need to render again so that any
80
+ * inner components will be unmounted
81
+ */
82
+ this.forceUpdate();
83
+ }
84
+ });
85
+ }
86
+ present(prevProps) {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ const _a = this.props, { children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent } = _a, cProps = __rest(_a, ["children", "isOpen", "onDidDismiss", "onDidPresent", "onWillDismiss", "onWillPresent"]);
89
+ const elementProps = Object.assign(Object.assign({}, cProps), { ref: this.props.forwardedRef, [didDismissEventName]: this.handleDismiss, [didPresentEventName]: (e) => this.props.onDidPresent && this.props.onDidPresent(e), [willDismissEventName]: (e) => this.props.onWillDismiss && this.props.onWillDismiss(e), [willPresentEventName]: (e) => this.props.onWillPresent && this.props.onWillPresent(e) });
90
+ this.overlay = yield controller.create(Object.assign(Object.assign({}, elementProps), { component: this.el, componentProps: {} }));
91
+ setRef(this.props.forwardedRef, this.overlay);
92
+ attachProps(this.overlay, elementProps, prevProps);
93
+ yield this.overlay.present();
94
+ });
95
+ }
96
+ render() {
97
+ /**
98
+ * Continue to render the component even when
99
+ * overlay is dismissing otherwise component
100
+ * will be hidden before animation is done.
101
+ */
102
+ return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
103
+ }
104
+ }
105
+ return React.forwardRef((props, ref) => {
106
+ return React.createElement(Overlay, Object.assign({}, props, { forwardedRef: ref }));
107
+ });
108
+ };
@@ -0,0 +1,2 @@
1
+ export { createReactComponent } from './createComponent';
2
+ export { createOverlayComponent } from './createOverlayComponent';
@@ -0,0 +1,2 @@
1
+ export { createReactComponent } from './createComponent';
2
+ export { createOverlayComponent } from './createOverlayComponent';
@@ -0,0 +1,29 @@
1
+ export interface EventEmitter<T = any> {
2
+ emit: (data?: T) => CustomEvent<T>;
3
+ }
4
+ export interface StyleReactProps {
5
+ class?: string;
6
+ className?: string;
7
+ style?: {
8
+ [key: string]: any;
9
+ };
10
+ }
11
+ export interface OverlayEventDetail<T = any> {
12
+ data?: T;
13
+ role?: string;
14
+ }
15
+ export interface OverlayInterface {
16
+ el: HTMLElement;
17
+ animated: boolean;
18
+ keyboardClose: boolean;
19
+ overlayIndex: number;
20
+ presented: boolean;
21
+ enterAnimation?: any;
22
+ leaveAnimation?: any;
23
+ didPresent: EventEmitter<void>;
24
+ willPresent: EventEmitter<void>;
25
+ willDismiss: EventEmitter<OverlayEventDetail>;
26
+ didDismiss: EventEmitter<OverlayEventDetail>;
27
+ present(): Promise<void>;
28
+ dismiss(data?: any, role?: string): Promise<boolean>;
29
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
2
+ export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
3
+ /**
4
+ * Checks if an event is supported in the current execution environment.
5
+ * @license Modernizr 3.0.0pre (Custom Build) | MIT
6
+ */
7
+ export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
8
+ export declare const syncEvent: (node: Element & {
9
+ __events?: {
10
+ [key: string]: (e: Event) => any;
11
+ };
12
+ }, eventName: string, newEventHandler?: (e: Event) => any) => void;
@@ -0,0 +1,97 @@
1
+ import { camelToDashCase } from './case';
2
+ export const attachProps = (node, newProps, oldProps = {}) => {
3
+ // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
4
+ if (node instanceof Element) {
5
+ // add any classes in className to the class list
6
+ const className = getClassName(node.classList, newProps, oldProps);
7
+ if (className !== '') {
8
+ node.className = className;
9
+ }
10
+ Object.keys(newProps).forEach((name) => {
11
+ if (name === 'children' ||
12
+ name === 'style' ||
13
+ name === 'ref' ||
14
+ name === 'class' ||
15
+ name === 'className' ||
16
+ name === 'forwardedRef') {
17
+ return;
18
+ }
19
+ if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
20
+ const eventName = name.substring(2);
21
+ const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
22
+ if (!isCoveredByReact(eventNameLc)) {
23
+ syncEvent(node, eventNameLc, newProps[name]);
24
+ }
25
+ }
26
+ else {
27
+ node[name] = newProps[name];
28
+ const propType = typeof newProps[name];
29
+ if (propType === 'string') {
30
+ node.setAttribute(camelToDashCase(name), newProps[name]);
31
+ }
32
+ }
33
+ });
34
+ }
35
+ };
36
+ export const getClassName = (classList, newProps, oldProps) => {
37
+ const newClassProp = newProps.className || newProps.class;
38
+ const oldClassProp = oldProps.className || oldProps.class;
39
+ // map the classes to Maps for performance
40
+ const currentClasses = arrayToMap(classList);
41
+ const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
42
+ const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
43
+ const finalClassNames = [];
44
+ // loop through each of the current classes on the component
45
+ // to see if it should be a part of the classNames added
46
+ currentClasses.forEach((currentClass) => {
47
+ if (incomingPropClasses.has(currentClass)) {
48
+ // add it as its already included in classnames coming in from newProps
49
+ finalClassNames.push(currentClass);
50
+ incomingPropClasses.delete(currentClass);
51
+ }
52
+ else if (!oldPropClasses.has(currentClass)) {
53
+ // add it as it has NOT been removed by user
54
+ finalClassNames.push(currentClass);
55
+ }
56
+ });
57
+ incomingPropClasses.forEach((s) => finalClassNames.push(s));
58
+ return finalClassNames.join(' ');
59
+ };
60
+ /**
61
+ * Checks if an event is supported in the current execution environment.
62
+ * @license Modernizr 3.0.0pre (Custom Build) | MIT
63
+ */
64
+ export const isCoveredByReact = (eventNameSuffix) => {
65
+ if (typeof document === 'undefined') {
66
+ return true;
67
+ }
68
+ else {
69
+ const eventName = 'on' + eventNameSuffix;
70
+ let isSupported = eventName in document;
71
+ if (!isSupported) {
72
+ const element = document.createElement('div');
73
+ element.setAttribute(eventName, 'return;');
74
+ isSupported = typeof element[eventName] === 'function';
75
+ }
76
+ return isSupported;
77
+ }
78
+ };
79
+ export const syncEvent = (node, eventName, newEventHandler) => {
80
+ const eventStore = node.__events || (node.__events = {});
81
+ const oldEventHandler = eventStore[eventName];
82
+ // Remove old listener so they don't double up.
83
+ if (oldEventHandler) {
84
+ node.removeEventListener(eventName, oldEventHandler);
85
+ }
86
+ // Bind new listener.
87
+ node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
88
+ if (newEventHandler) {
89
+ newEventHandler.call(this, e);
90
+ }
91
+ }));
92
+ };
93
+ const arrayToMap = (arr) => {
94
+ const map = new Map();
95
+ arr.forEach((s) => map.set(s, s));
96
+ return map;
97
+ };
@@ -0,0 +1,2 @@
1
+ export declare const dashToPascalCase: (str: string) => string;
2
+ export declare const camelToDashCase: (str: string) => string;
@@ -0,0 +1,6 @@
1
+ export const dashToPascalCase = (str) => str
2
+ .toLowerCase()
3
+ .split('-')
4
+ .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
5
+ .join('');
6
+ export const camelToDashCase = (str) => str.replace(/([A-Z])/g, (m) => `-${m[0].toLowerCase()}`);
@@ -0,0 +1,2 @@
1
+ export declare const isDevMode: () => boolean;
2
+ export declare const deprecationWarning: (key: string, message: string) => void;
@@ -0,0 +1,12 @@
1
+ export const isDevMode = () => {
2
+ return process && process.env && process.env.NODE_ENV === 'development';
3
+ };
4
+ const warnings = {};
5
+ export const deprecationWarning = (key, message) => {
6
+ if (isDevMode()) {
7
+ if (!warnings[key]) {
8
+ console.warn(message);
9
+ warnings[key] = true;
10
+ }
11
+ }
12
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { StyleReactProps } from '../interfaces';
3
+ export declare type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
4
+ export declare type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;
5
+ export declare const setRef: (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => void;
6
+ export declare const mergeRefs: (...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]) => React.RefCallback<any>;
7
+ export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<PropType & Omit<React.HTMLAttributes<ElementType>, "style"> & StyleReactProps> & React.RefAttributes<ElementType>>;
8
+ export declare const defineCustomElement: (tagName: string, customElement: any) => void;
9
+ export * from './attachProps';
10
+ export * from './case';
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ export const setRef = (ref, value) => {
3
+ if (typeof ref === 'function') {
4
+ ref(value);
5
+ }
6
+ else if (ref != null) {
7
+ // Cast as a MutableRef so we can assign current
8
+ ref.current = value;
9
+ }
10
+ };
11
+ export const mergeRefs = (...refs) => {
12
+ return (value) => {
13
+ refs.forEach(ref => {
14
+ setRef(ref, value);
15
+ });
16
+ };
17
+ };
18
+ export const createForwardRef = (ReactComponent, displayName) => {
19
+ const forwardRef = (props, ref) => {
20
+ return React.createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));
21
+ };
22
+ forwardRef.displayName = displayName;
23
+ return React.forwardRef(forwardRef);
24
+ };
25
+ export const defineCustomElement = (tagName, customElement) => {
26
+ if (customElement !== undefined &&
27
+ typeof customElements !== 'undefined' &&
28
+ !customElements.get(tagName)) {
29
+ customElements.define(tagName, customElement);
30
+ }
31
+ };
32
+ export * from './attachProps';
33
+ export * from './case';
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@ukic/react",
3
+ "sideEffects": false,
4
+ "version": "2.0.0-alpha.121",
5
+ "description": "React components compiled using web components and StencilJS",
6
+ "scripts": {
7
+ "build": "npm run clean && npm run compile && npm run copy:css",
8
+ "clean": "rm -rf dist",
9
+ "compile": "npm run tsc",
10
+ "tsc": "tsc -p .",
11
+ "rollup": "rollup -c",
12
+ "storybook": "start-storybook -p 6007 --no-manager-cache",
13
+ "build-storybook": "rm -rf ./storybook-static && build-storybook -s public",
14
+ "audit": "echo 'Audit for: @ukic/react' && audit-ci -m --config ../../audit-ci.json",
15
+ "copy:css": "echo 'Copy core css from: @ukic/web-components' && mkdirp -p ./dist/core && cp ../web-components/dist/core/core.css ./dist/core"
16
+ },
17
+ "main": "./dist/index.js",
18
+ "module": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "files": [
21
+ "dist/"
22
+ ],
23
+ "dependencies": {
24
+ "@ukic/fonts": "^2.0.0-alpha.116",
25
+ "@ukic/web-components": "^2.0.0-alpha.121"
26
+ },
27
+ "devDependencies": {
28
+ "@babel/core": "^7.16.0",
29
+ "@storybook/addon-a11y": "^6.4.8",
30
+ "@storybook/addon-actions": "^6.4.8",
31
+ "@storybook/addon-docs": "^6.4.8",
32
+ "@storybook/addon-essentials": "^6.4.8",
33
+ "@storybook/addon-links": "^6.4.8",
34
+ "@storybook/addon-postcss": "^2.0.0",
35
+ "@storybook/react": "^6.4.8",
36
+ "@types/jest": "27.0.3",
37
+ "@types/node": "^16.11.11",
38
+ "@types/react": "^17.0.37",
39
+ "@types/react-dom": "^17.0.11",
40
+ "babel-loader": "^8.2.3",
41
+ "jest": "^27.4.1",
42
+ "jest-dom": "^4.0.0",
43
+ "mkdirp": "^1.0.4",
44
+ "np": "^7.6.0",
45
+ "react": "^17.0.2",
46
+ "react-dom": "^17.0.2",
47
+ "react-hook-form": "^7.38.0",
48
+ "react-router-dom": "^6.3.0",
49
+ "typescript": "^4.5.2"
50
+ },
51
+ "peerDependencies": {
52
+ "react": "^17.0.2 || ^18.2.0",
53
+ "react-dom": "^17.0.2 || ^18.2.0"
54
+ },
55
+ "jest": {
56
+ "preset": "ts-jest",
57
+ "setupTestFrameworkScriptFile": "<rootDir>/jest.setup.js",
58
+ "testPathIgnorePatterns": [
59
+ "node_modules",
60
+ "dist"
61
+ ]
62
+ }
63
+ }