styled-components 6.0.6-test.0 → 6.0.7

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 (102) hide show
  1. package/dist/hoc/withTheme.d.ts +1 -1
  2. package/dist/models/ComponentStyle.d.ts +1 -1
  3. package/dist/models/StyleSheetManager.d.ts +1 -1
  4. package/dist/models/ThemeProvider.d.ts +1 -1
  5. package/dist/sheet/Sheet.d.ts +3 -3
  6. package/dist/sheet/Tag.d.ts +7 -7
  7. package/dist/sheet/dom.d.ts +1 -1
  8. package/dist/sheet/types.d.ts +1 -1
  9. package/dist/styled-components.browser.cjs.js +1 -1
  10. package/dist/styled-components.browser.cjs.js.map +1 -1
  11. package/dist/styled-components.browser.esm.js +1 -1
  12. package/dist/styled-components.browser.esm.js.map +1 -1
  13. package/dist/styled-components.cjs.js +1 -1
  14. package/dist/styled-components.cjs.js.map +1 -1
  15. package/dist/styled-components.esm.js +1 -1
  16. package/dist/styled-components.esm.js.map +1 -1
  17. package/dist/styled-components.js +3 -11
  18. package/dist/styled-components.js.map +1 -1
  19. package/dist/styled-components.min.js +1 -1
  20. package/dist/styled-components.min.js.map +1 -1
  21. package/dist/test/utils.d.ts +0 -1
  22. package/dist/types.d.ts +15 -15
  23. package/dist/utils/checkDynamicCreation.d.ts +1 -1
  24. package/dist/utils/determineTheme.d.ts +2 -2
  25. package/dist/utils/flatten.d.ts +1 -1
  26. package/dist/utils/hoist.d.ts +1 -1
  27. package/dist/utils/joinStrings.d.ts +2 -2
  28. package/dist/utils/stylis.d.ts +4 -4
  29. package/native/dist/base.d.ts +12 -0
  30. package/native/dist/constants.d.ts +8 -0
  31. package/native/dist/constructors/constructWithOptions.d.ts +18 -0
  32. package/native/dist/constructors/createGlobalStyle.d.ts +3 -0
  33. package/native/dist/constructors/css.d.ts +4 -0
  34. package/native/dist/constructors/keyframes.d.ts +3 -0
  35. package/native/dist/constructors/styled.d.ts +180 -0
  36. package/native/dist/hoc/withTheme.d.ts +3 -0
  37. package/native/dist/hoc/withTheme.spec.d.ts +1 -0
  38. package/native/dist/index-standalone.d.ts +2 -0
  39. package/native/dist/index.d.ts +4 -0
  40. package/native/dist/macro/index.d.ts +2 -0
  41. package/native/dist/models/ComponentStyle.d.ts +15 -0
  42. package/native/dist/models/GlobalStyle.d.ts +11 -0
  43. package/native/dist/models/InlineStyle.d.ts +6 -0
  44. package/native/dist/models/Keyframes.d.ts +10 -0
  45. package/native/dist/models/ServerStyleSheet.d.ts +16 -0
  46. package/native/dist/models/StyleSheetManager.d.ts +65 -0
  47. package/native/dist/models/StyledComponent.d.ts +3 -0
  48. package/native/dist/models/StyledNativeComponent.d.ts +3 -0
  49. package/native/dist/models/ThemeProvider.d.ts +47 -0
  50. package/native/dist/native/index.d.ts +36 -0
  51. package/native/dist/secretInternals.d.ts +5 -0
  52. package/native/dist/sheet/GroupIDAllocator.d.ts +4 -0
  53. package/native/dist/sheet/GroupedTag.d.ts +11 -0
  54. package/native/dist/sheet/Rehydration.d.ts +3 -0
  55. package/native/dist/sheet/Sheet.d.ts +38 -0
  56. package/native/dist/sheet/Tag.d.ts +54 -0
  57. package/native/dist/sheet/dom.d.ts +4 -0
  58. package/native/dist/sheet/index.d.ts +1 -0
  59. package/native/dist/sheet/types.d.ts +34 -0
  60. package/native/dist/styled-components.native.cjs.js +2 -0
  61. package/native/dist/styled-components.native.cjs.js.map +1 -0
  62. package/native/dist/styled-components.native.esm.js +2 -0
  63. package/native/dist/styled-components.native.esm.js.map +1 -0
  64. package/native/dist/test/globals.d.ts +2 -0
  65. package/native/dist/test/utils.d.ts +186 -0
  66. package/native/dist/test/veryLargeUnionType.d.ts +1 -0
  67. package/native/dist/types.d.ts +161 -0
  68. package/native/dist/utils/addUnitIfNeeded.d.ts +1 -0
  69. package/native/dist/utils/checkDynamicCreation.d.ts +1 -0
  70. package/native/dist/utils/createWarnTooManyClasses.d.ts +3 -0
  71. package/native/dist/utils/determineTheme.d.ts +4 -0
  72. package/native/dist/utils/domElements.d.ts +2 -0
  73. package/native/dist/utils/empties.d.ts +3 -0
  74. package/native/dist/utils/error.d.ts +5 -0
  75. package/native/dist/utils/errors.d.ts +21 -0
  76. package/native/dist/utils/escape.d.ts +5 -0
  77. package/native/dist/utils/flatten.d.ts +4 -0
  78. package/native/dist/utils/generateAlphabeticName.d.ts +1 -0
  79. package/native/dist/utils/generateComponentId.d.ts +1 -0
  80. package/native/dist/utils/generateDisplayName.d.ts +2 -0
  81. package/native/dist/utils/getComponentName.d.ts +2 -0
  82. package/native/dist/utils/hash.d.ts +3 -0
  83. package/native/dist/utils/hoist.d.ts +51 -0
  84. package/native/dist/utils/hyphenateStyleName.d.ts +14 -0
  85. package/native/dist/utils/interleave.d.ts +2 -0
  86. package/native/dist/utils/isFunction.d.ts +1 -0
  87. package/native/dist/utils/isPlainObject.d.ts +1 -0
  88. package/native/dist/utils/isStatelessFunction.d.ts +1 -0
  89. package/native/dist/utils/isStaticRules.d.ts +2 -0
  90. package/native/dist/utils/isStyledComponent.d.ts +2 -0
  91. package/native/dist/utils/isTag.d.ts +2 -0
  92. package/native/dist/utils/joinStrings.d.ts +5 -0
  93. package/native/dist/utils/mixinDeep.d.ts +6 -0
  94. package/native/dist/utils/nonce.d.ts +1 -0
  95. package/native/dist/utils/setToString.d.ts +17 -0
  96. package/native/dist/utils/stylis.d.ts +10 -0
  97. package/native/package.json +4 -4
  98. package/package.json +2 -25
  99. package/dist/styled-components.native.cjs.js +0 -2
  100. package/dist/styled-components.native.cjs.js.map +0 -1
  101. package/dist/styled-components.native.esm.js +0 -2
  102. package/dist/styled-components.native.esm.js.map +0 -1
@@ -0,0 +1 @@
1
+ export type VeryLargeUnionType = 'add-clip' | 'add-column-left' | 'add-column-right' | 'add-location' | 'add-row-bottom' | 'add-row-top' | 'add-to-artifact' | 'add-to-folder' | 'add' | 'aimpoints-target' | 'airplane' | 'align-center' | 'align-justify' | 'align-left' | 'align-right' | 'alignment-bottom' | 'alignment-horizontal-center' | 'alignment-left' | 'alignment-right' | 'alignment-top' | 'alignment-vertical-center' | 'anchor' | 'annotation' | 'antenna' | 'app-header' | 'application' | 'applications' | 'archive' | 'area-of-interest' | 'array-boolean' | 'array-date' | 'array-floating-point' | 'array-numeric' | 'array-string' | 'array-timestamp' | 'array' | 'arrow-bottom-left' | 'arrow-bottom-right' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrow-top-left' | 'arrow-top-right' | 'arrow-up' | 'arrows-horizontal' | 'arrows-vertical' | 'asterisk' | 'at' | 'automatic-updates' | 'axle' | 'backlink' | 'badge' | 'ban-circle' | 'bank-account' | 'barcode' | 'blank' | 'blocked-person' | 'bold' | 'book' | 'bookmark' | 'box' | 'briefcase' | 'bring-data' | 'bug' | 'buggy' | 'build' | 'calculator' | 'calendar' | 'camera' | 'caret-down' | 'caret-left' | 'caret-right' | 'caret-up' | 'cargo-ship' | 'cell-tower' | 'changes' | 'chart' | 'chat' | 'chevron-backward' | 'chevron-down' | 'chevron-forward' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'circle-arrow-down' | 'circle-arrow-left' | 'circle-arrow-right' | 'circle-arrow-up' | 'circle' | 'citation' | 'clean' | 'clip' | 'clipboard' | 'cloud-download' | 'cloud-upload' | 'cloud' | 'code-block' | 'code' | 'cog' | 'collapse-all' | 'color-fill' | 'column-layout' | 'comment' | 'comparison' | 'compass' | 'compressed' | 'confirm' | 'console' | 'contrast' | 'control' | 'credit-card' | 'cross-circle' | 'cross' | 'crown' | 'cube-add' | 'cube-remove' | 'cube' | 'curved-range-chart' | 'cut' | 'cycle' | 'dashboard' | 'data-connection' | 'data-lineage' | 'database' | 'delete' | 'delta' | 'derive-column' | 'desktop' | 'diagnosis' | 'diagram-tree' | 'direction-left' | 'direction-right' | 'disable' | 'divide' | 'document-open' | 'document-share' | 'document' | 'dollar' | 'dot' | 'double-caret-horizontal' | 'double-caret-vertical' | 'double-chevron-down' | 'double-chevron-left' | 'double-chevron-right' | 'double-chevron-up' | 'doughnut-chart' | 'download' | 'drag-handle-horizontal' | 'drag-handle-vertical' | 'draw' | 'drawer-left-filled' | 'drawer-left' | 'drawer-right-filled' | 'drawer-right' | 'drive-time' | 'duplicate' | 'edit' | 'eject' | 'emoji' | 'endorsed' | 'envelope' | 'equals' | 'eraser' | 'error' | 'euro' | 'exchange' | 'exclude-row' | 'expand-all' | 'export' | 'eye-off' | 'eye-on' | 'eye-open' | 'fast-backward' | 'fast-forward' | 'feed-subscribed' | 'feed' | 'film' | 'filter-keep' | 'filter-list' | 'filter-open' | 'filter-remove' | 'filter' | 'flag' | 'flame' | 'flash' | 'floating-point' | 'floppy-disk' | 'flow-branch' | 'flow-end' | 'flow-linear' | 'flow-review-branch' | 'flow-review' | 'flows' | 'folder-close' | 'folder-new' | 'folder-open' | 'folder-shared-open' | 'folder-shared' | 'follower' | 'following' | 'font' | 'fork' | 'form' | 'fuel' | 'full-circle' | 'full-stacked-chart' | 'fullscreen' | 'function' | 'gantt-chart' | 'geofence' | 'geolocation' | 'geosearch' | 'git-branch' | 'git-commit' | 'git-merge' | 'git-new-branch' | 'git-pull' | 'git-push' | 'git-repo' | 'glass' | 'globe-network' | 'globe' | 'graph-remove' | 'graph' | 'greater-than-or-equal-to' | 'greater-than' | 'grid-view' | 'grid' | 'group-objects' | 'grouped-bar-chart' | 'hand-down' | 'hand-left' | 'hand-right' | 'hand-up' | 'hand' | 'hat' | 'header-one' | 'header-three' | 'header-two' | 'header' | 'headset' | 'heart-broken' | 'heart' | 'heat-grid' | 'heatmap' | 'helicopter' | 'help' | 'helper-management' | 'high-priority' | 'high-voltage-pole' | 'highlight' | 'history' | 'home' | 'horizontal-bar-chart-asc' | 'horizontal-bar-chart-desc' | 'horizontal-bar-chart' | 'horizontal-distribution' | 'horizontal-inbetween' | 'hurricane' | 'id-number' | 'image-rotate-left' | 'image-rotate-right' | 'import' | 'inbox-filtered' | 'inbox-geo' | 'inbox-search' | 'inbox-update' | 'inbox' | 'info-sign' | 'inheritance' | 'inherited-group' | 'inner-join' | 'insert' | 'intelligence' | 'intersection' | 'ip-address' | 'issue-closed' | 'issue-new' | 'issue' | 'italic' | 'join-table' | 'key-backspace' | 'key-command' | 'key-control' | 'key-delete' | 'key-enter' | 'key-escape' | 'key-option' | 'key-shift' | 'key-tab' | 'key' | 'known-vehicle' | 'lab-test' | 'label' | 'layer-outline' | 'layer' | 'layers' | 'layout-auto' | 'layout-balloon' | 'layout-circle' | 'layout-grid' | 'layout-group-by' | 'layout-hierarchy' | 'layout-linear' | 'layout-skew-grid' | 'layout-sorted-clusters' | 'layout' | 'learning' | 'left-join' | 'less-than-or-equal-to' | 'less-than' | 'lifesaver' | 'lightbulb' | 'lightning' | 'link' | 'list-columns' | 'list-detail-view' | 'list' | 'locate' | 'lock' | 'locomotive' | 'log-in' | 'log-out' | 'low-voltage-pole' | 'manual' | 'manually-entered-data' | 'many-to-many' | 'many-to-one' | 'map-create' | 'map-marker' | 'map' | 'maximize' | 'media' | 'menu-closed' | 'menu-open' | 'menu' | 'merge-columns' | 'merge-links' | 'minimize' | 'minus' | 'mobile-phone' | 'mobile-video' | 'modal-filled' | 'modal' | 'model' | 'moon' | 'more' | 'mountain' | 'move' | 'mugshot' | 'multi-select' | 'music' | 'nest' | 'new-drawing' | 'new-grid-item' | 'new-layer' | 'new-layers' | 'new-link' | 'new-object' | 'new-person' | 'new-prescription' | 'new-text-box' | 'ninja' | 'not-equal-to' | 'notifications-snooze' | 'notifications-updated' | 'notifications' | 'numbered-list' | 'numerical' | 'office' | 'offline' | 'oil-field' | 'one-column' | 'one-to-many' | 'one-to-one' | 'open-application' | 'outdated' | 'page-layout' | 'panel-stats' | 'panel-table' | 'paperclip' | 'paragraph' | 'path-search' | 'path' | 'pause' | 'people' | 'percentage' | 'person' | 'phone' | 'pie-chart' | 'pin' | 'pivot-table' | 'pivot' | 'play' | 'playbook' | 'plus' | 'polygon-filter' | 'power' | 'predictive-analysis' | 'prescription' | 'presentation' | 'print' | 'projects' | 'properties' | 'property' | 'publish-function' | 'pulse' | 'rain' | 'random' | 'record' | 'rect-height' | 'rect-width' | 'rectangle' | 'redo' | 'refresh' | 'regex' | 'regression-chart' | 'remove-column-left' | 'remove-column-right' | 'remove-column' | 'remove-row-bottom' | 'remove-row-top' | 'remove' | 'repeat' | 'reset' | 'resolve' | 'rig' | 'right-join' | 'ring' | 'rocket-slant' | 'rocket' | 'rotate-document' | 'rotate-page' | 'route' | 'satellite' | 'saved' | 'scatter-plot' | 'search-around' | 'search-template' | 'search-text' | 'search' | 'segmented-control' | 'select' | 'selection' | 'send-message' | 'send-to-graph' | 'send-to-map' | 'send-to' | 'sensor' | 'series-add' | 'series-configuration' | 'series-derived' | 'series-filtered' | 'series-search' | 'settings' | 'shapes' | 'share' | 'shared-filter' | 'shield' | 'ship' | 'shop' | 'shopping-cart' | 'signal-search' | 'sim-card' | 'slash' | 'small-cross' | 'small-info-sign' | 'small-minus' | 'small-plus' | 'small-square' | 'small-tick' | 'snowflake' | 'social-media' | 'sort-alphabetical-desc' | 'sort-alphabetical' | 'sort-asc' | 'sort-desc' | 'sort-numerical-desc' | 'sort-numerical' | 'sort' | 'split-columns' | 'square' | 'stacked-chart' | 'stadium-geometry' | 'star-empty' | 'star' | 'step-backward' | 'step-chart' | 'step-forward' | 'stop' | 'stopwatch' | 'strikethrough' | 'style' | 'subscript' | 'superscript' | 'swap-horizontal' | 'swap-vertical' | 'switch' | 'symbol-circle' | 'symbol-cross' | 'symbol-diamond' | 'symbol-rectangle' | 'symbol-square' | 'symbol-triangle-down' | 'symbol-triangle-up' | 'syringe' | 'tag' | 'take-action' | 'tank' | 'target' | 'taxi' | 'temperature' | 'text-highlight' | 'th-derived' | 'th-disconnect' | 'th-filtered' | 'th-list' | 'th' | 'third-party' | 'thumbs-down' | 'thumbs-up' | 'tick-circle' | 'tick' | 'time' | 'timeline-area-chart' | 'timeline-bar-chart' | 'timeline-events' | 'timeline-line-chart' | 'tint' | 'torch' | 'tractor' | 'train' | 'translate' | 'trash' | 'tree' | 'trending-down' | 'trending-up' | 'truck' | 'two-columns' | 'unarchive' | 'underline' | 'undo' | 'ungroup-objects' | 'unknown-vehicle' | 'unlock' | 'unpin' | 'unresolve' | 'updated' | 'upload' | 'user' | 'variable' | 'vertical-bar-chart-asc' | 'vertical-bar-chart-desc' | 'vertical-distribution' | 'vertical-inbetween' | 'video' | 'virus' | 'volume-down' | 'volume-off' | 'volume-up' | 'walk' | 'warning-sign' | 'waterfall-chart' | 'waves' | 'widget-button' | 'widget-footer' | 'widget-header' | 'widget' | 'wind' | 'wrench' | 'zoom-in' | 'zoom-out' | 'zoom-to-fit';
@@ -0,0 +1,161 @@
1
+ import type * as CSS from 'csstype';
2
+ import React from 'react';
3
+ import ComponentStyle from './models/ComponentStyle';
4
+ import { DefaultTheme } from './models/ThemeProvider';
5
+ import createWarnTooManyClasses from './utils/createWarnTooManyClasses';
6
+ export { CSS, DefaultTheme };
7
+ interface ExoticComponentWithDisplayName<P extends object = {}> extends React.ExoticComponent<P> {
8
+ defaultProps?: Partial<P> | undefined;
9
+ displayName?: string | undefined;
10
+ }
11
+ /**
12
+ * Use this type to disambiguate between a styled-component instance
13
+ * and a StyleFunction or any other type of function.
14
+ */
15
+ export type StyledComponentBrand = {
16
+ readonly _sc: symbol;
17
+ };
18
+ export type BaseObject = {};
19
+ export type OmitNever<T> = {
20
+ [K in keyof T as T[K] extends never ? never : K]: T[K];
21
+ };
22
+ type FastOmit<T extends object, U extends string | number | symbol> = {
23
+ [K in keyof T as K extends U ? never : K]: T[K];
24
+ };
25
+ export type Runtime = 'web' | 'native';
26
+ export type AnyComponent<P extends object = any> = ExoticComponentWithDisplayName<P> | React.ComponentType<P>;
27
+ export type KnownTarget = Exclude<keyof JSX.IntrinsicElements, 'symbol' | 'object'> | AnyComponent;
28
+ export type WebTarget = string | KnownTarget;
29
+ export type NativeTarget = AnyComponent;
30
+ export type StyledTarget<R extends Runtime> = R extends 'web' ? WebTarget : NativeTarget;
31
+ export interface StyledOptions<R extends Runtime, Props extends object> {
32
+ attrs?: Attrs<Props>[] | undefined;
33
+ componentId?: (R extends 'web' ? string : never) | undefined;
34
+ displayName?: string | undefined;
35
+ parentComponentId?: (R extends 'web' ? string : never) | undefined;
36
+ shouldForwardProp?: ShouldForwardProp<R> | undefined;
37
+ }
38
+ export type Dict<T = any> = {
39
+ [key: string]: T;
40
+ };
41
+ export type DataAttributes = {
42
+ [key: `data-${string}`]: any;
43
+ };
44
+ export type ExecutionProps = {
45
+ /**
46
+ * Dynamically adjust the rendered component or HTML tag, e.g.
47
+ * ```
48
+ * const StyledButton = styled.button``
49
+ *
50
+ * <StyledButton as="a" href="/foo">
51
+ * I'm an anchor now
52
+ * </StyledButton>
53
+ * ```
54
+ */
55
+ as?: KnownTarget | undefined;
56
+ forwardedAs?: KnownTarget | undefined;
57
+ theme?: DefaultTheme | undefined;
58
+ };
59
+ /**
60
+ * ExecutionProps but with `theme` required.
61
+ */
62
+ export interface ExecutionContext extends ExecutionProps {
63
+ theme: DefaultTheme;
64
+ }
65
+ export interface StyleFunction<Props extends object> {
66
+ (executionContext: ExecutionContext & Props): Interpolation<Props>;
67
+ }
68
+ export type Interpolation<Props extends object> = StyleFunction<Props> | StyledObject<Props> | TemplateStringsArray | string | number | false | undefined | null | Keyframes | StyledComponentBrand | RuleSet<Props> | Interpolation<Props>[];
69
+ export type Attrs<Props extends object = BaseObject> = (ExecutionProps & Partial<Props>) | ((props: ExecutionContext & Props) => ExecutionProps & Partial<Props>);
70
+ export type RuleSet<Props extends object = BaseObject> = Interpolation<Props>[];
71
+ export type Styles<Props extends object> = TemplateStringsArray | StyledObject<Props> | StyleFunction<Props>;
72
+ export type NameGenerator = (hash: number) => string;
73
+ export interface StyleSheet {
74
+ create: Function;
75
+ }
76
+ export interface Keyframes {
77
+ id: string;
78
+ name: string;
79
+ rules: string;
80
+ }
81
+ export interface Flattener<Props extends object> {
82
+ (chunks: Interpolation<Props>[], executionContext: object | null | undefined, styleSheet: StyleSheet | null | undefined): Interpolation<Props>[];
83
+ }
84
+ export interface Stringifier {
85
+ (css: string, selector?: string | undefined, prefix?: string | undefined, componentId?: string | undefined): string[];
86
+ hash: string;
87
+ }
88
+ export interface ShouldForwardProp<R extends Runtime> {
89
+ (prop: string, elementToBeCreated: StyledTarget<R>): boolean;
90
+ }
91
+ export interface CommonStatics<R extends Runtime, Props extends object> {
92
+ attrs: Attrs<Props>[];
93
+ target: StyledTarget<R>;
94
+ shouldForwardProp?: ShouldForwardProp<R> | undefined;
95
+ }
96
+ export interface IStyledStatics<R extends Runtime, OuterProps extends object> extends CommonStatics<R, OuterProps> {
97
+ componentStyle: R extends 'web' ? ComponentStyle : never;
98
+ foldedComponentIds: R extends 'web' ? string : never;
99
+ inlineStyle: R extends 'native' ? InstanceType<IInlineStyleConstructor<OuterProps>> : never;
100
+ target: StyledTarget<R>;
101
+ styledComponentId: R extends 'web' ? string : never;
102
+ warnTooManyClasses?: (R extends 'web' ? ReturnType<typeof createWarnTooManyClasses> : never) | undefined;
103
+ }
104
+ /**
105
+ * Used by PolymorphicComponent to define prop override cascading order.
106
+ */
107
+ export type PolymorphicComponentProps<R extends Runtime, BaseProps extends object, AsTarget extends StyledTarget<R> | void, ForwardedAsTarget extends StyledTarget<R> | void, AsTargetProps extends object = AsTarget extends KnownTarget ? React.ComponentPropsWithRef<AsTarget> : {}, ForwardedAsTargetProps extends object = ForwardedAsTarget extends KnownTarget ? React.ComponentPropsWithoutRef<ForwardedAsTarget> : {}> = NoInfer<FastOmit<Substitute<BaseProps, Substitute<ForwardedAsTargetProps, AsTargetProps>>, keyof ExecutionProps>> & FastOmit<ExecutionProps, 'as' | 'forwardedAs'> & {
108
+ as?: AsTarget;
109
+ forwardedAs?: ForwardedAsTarget;
110
+ };
111
+ /**
112
+ * This type forms the signature for a forwardRef-enabled component
113
+ * that accepts the "as" prop to dynamically change the underlying
114
+ * rendered JSX. The interface will automatically attempt to extract
115
+ * props from the given rendering target to get proper typing for
116
+ * any specialized props in the target component.
117
+ */
118
+ export interface PolymorphicComponent<R extends Runtime, BaseProps extends object> extends React.ForwardRefExoticComponent<BaseProps> {
119
+ <AsTarget extends StyledTarget<R> | void = void, ForwardedAsTarget extends StyledTarget<R> | void = void>(props: PolymorphicComponentProps<R, BaseProps, AsTarget, ForwardedAsTarget>): JSX.Element;
120
+ }
121
+ export interface IStyledComponent<R extends Runtime, Props extends object = BaseObject> extends PolymorphicComponent<R, Props>, IStyledStatics<R, Props>, StyledComponentBrand {
122
+ defaultProps?: (ExecutionProps & Partial<Props>) | undefined;
123
+ toString: () => string;
124
+ }
125
+ export interface IStyledComponentFactory<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends object, OuterStatics extends object = BaseObject> {
126
+ <Props extends object = BaseObject, Statics extends object = BaseObject>(target: Target, options: StyledOptions<R, OuterProps & Props>, rules: RuleSet<OuterProps & Props>): IStyledComponent<R, Substitute<OuterProps, Props>> & OuterStatics & Statics;
127
+ }
128
+ export interface IInlineStyleConstructor<Props extends object> {
129
+ new (rules: RuleSet<Props>): IInlineStyle<Props>;
130
+ }
131
+ export interface IInlineStyle<Props extends object> {
132
+ rules: RuleSet<Props>;
133
+ generateStyleObject(executionContext: ExecutionContext & Props): object;
134
+ }
135
+ export type StyledObject<Props extends object> = CSS.Properties<number | (string & {})> & {
136
+ [key: string]: string | number | StyleFunction<Props> | StyledObject<Props> | RuleSet<any> | undefined;
137
+ };
138
+ /**
139
+ * The `css` prop is not declared by default in the types as it would cause `css` to be present
140
+ * on the types of anything that uses styled-components indirectly, even if they do not use the
141
+ * babel plugin.
142
+ *
143
+ * To enable support for the `css` prop in TypeScript, create a `styled-components.d.ts` file in
144
+ * your project source with the following contents:
145
+ *
146
+ * ```ts
147
+ * import type { CSSProp } from "styled-components";
148
+ *
149
+ * declare module "react" {
150
+ * interface Attributes {
151
+ * css?: CSSProp;
152
+ * }
153
+ * }
154
+ * ```
155
+ *
156
+ * In order to get accurate typings for `props.theme` in `css` interpolations, see
157
+ * {@link DefaultTheme}.
158
+ */
159
+ export type CSSProp = Interpolation<any>;
160
+ export type NoInfer<T> = [T][T extends any ? 0 : never];
161
+ export type Substitute<A extends object, B extends object> = FastOmit<A, keyof B> & B;
@@ -0,0 +1 @@
1
+ export default function addUnitIfNeeded(name: string, value: any): string;
@@ -0,0 +1 @@
1
+ export declare const checkDynamicCreation: (displayName: string, componentId?: string | undefined) => void;
@@ -0,0 +1,3 @@
1
+ export declare const LIMIT = 200;
2
+ declare const _default: (displayName: string, componentId: string) => (className: string) => void;
3
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { DefaultTheme, ExecutionProps } from '../types';
2
+ export default function determineTheme(props: ExecutionProps, providedTheme?: DefaultTheme | undefined, defaultProps?: {
3
+ theme?: DefaultTheme | undefined;
4
+ }): DefaultTheme | undefined;
@@ -0,0 +1,2 @@
1
+ declare const _default: Set<"object" | "g" | "big" | "link" | "small" | "sub" | "sup" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "summary" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "svg" | "circle" | "clipPath" | "defs" | "ellipse" | "foreignObject" | "image" | "line" | "linearGradient" | "marker" | "mask" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "text" | "tspan" | "use">;
2
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { Dict } from '../types';
2
+ export declare const EMPTY_ARRAY: readonly any[];
3
+ export declare const EMPTY_OBJECT: Readonly<Dict<any>>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Create an error file out of errors.md for development and a simple web link to the full errors
3
+ * in production mode.
4
+ */
5
+ export default function throwStyledComponentsError(code: string | number, ...interpolations: any[]): Error;
@@ -0,0 +1,21 @@
1
+ declare const _default: {
2
+ '1': string;
3
+ '2': string;
4
+ '3': string;
5
+ '4': string;
6
+ '5': string;
7
+ '6': string;
8
+ '7': string;
9
+ '8': string;
10
+ '9': string;
11
+ '10': string;
12
+ '11': string;
13
+ '12': string;
14
+ '13': string;
15
+ '14': string;
16
+ '15': string;
17
+ '16': string;
18
+ '17': string;
19
+ '18': string;
20
+ };
21
+ export default _default;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * TODO: Explore using CSS.escape when it becomes more available
3
+ * in evergreen browsers.
4
+ */
5
+ export default function escape(str: string): string;
@@ -0,0 +1,4 @@
1
+ import StyleSheet from '../sheet';
2
+ import { Dict, ExecutionContext, Interpolation, RuleSet, Stringifier } from '../types';
3
+ export declare const objToCssArray: (obj: Dict<any>) => string[];
4
+ export default function flatten<Props extends object>(chunk: Interpolation<object>, executionContext?: (ExecutionContext & Props) | undefined, styleSheet?: StyleSheet | undefined, stylisInstance?: Stringifier | undefined): RuleSet<Props>;
@@ -0,0 +1 @@
1
+ export default function generateAlphabeticName(code: number): string;
@@ -0,0 +1 @@
1
+ export default function generateComponentId(str: string): string;
@@ -0,0 +1,2 @@
1
+ import { StyledTarget } from '../types';
2
+ export default function generateDisplayName(target: StyledTarget<any>): string;
@@ -0,0 +1,2 @@
1
+ import { StyledTarget } from '../types';
2
+ export default function getComponentName(target: StyledTarget<any>): string;
@@ -0,0 +1,3 @@
1
+ export declare const SEED = 5381;
2
+ export declare const phash: (h: number, x: string) => number;
3
+ export declare const hash: (x: string) => number;
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import { AnyComponent } from '../types';
3
+ /**
4
+ * Adapted from hoist-non-react-statics to avoid the react-is dependency.
5
+ */
6
+ declare const REACT_STATICS: {
7
+ childContextTypes: boolean;
8
+ contextType: boolean;
9
+ contextTypes: boolean;
10
+ defaultProps: boolean;
11
+ displayName: boolean;
12
+ getDefaultProps: boolean;
13
+ getDerivedStateFromError: boolean;
14
+ getDerivedStateFromProps: boolean;
15
+ mixins: boolean;
16
+ propTypes: boolean;
17
+ type: boolean;
18
+ };
19
+ declare const KNOWN_STATICS: {
20
+ name: boolean;
21
+ length: boolean;
22
+ prototype: boolean;
23
+ caller: boolean;
24
+ callee: boolean;
25
+ arguments: boolean;
26
+ arity: boolean;
27
+ };
28
+ declare const FORWARD_REF_STATICS: {
29
+ $$typeof: boolean;
30
+ render: boolean;
31
+ defaultProps: boolean;
32
+ displayName: boolean;
33
+ propTypes: boolean;
34
+ };
35
+ declare const MEMO_STATICS: {
36
+ $$typeof: boolean;
37
+ compare: boolean;
38
+ defaultProps: boolean;
39
+ displayName: boolean;
40
+ propTypes: boolean;
41
+ type: boolean;
42
+ };
43
+ type OmniComponent = AnyComponent;
44
+ type ExcludeList = {
45
+ [key: string]: true;
46
+ };
47
+ type NonReactStatics<S extends OmniComponent, C extends ExcludeList = {}> = {
48
+ [key in Exclude<keyof S, S extends React.MemoExoticComponent<any> ? keyof typeof MEMO_STATICS | keyof C : S extends React.ForwardRefExoticComponent<any> ? keyof typeof FORWARD_REF_STATICS | keyof C : keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C>]: S[key];
49
+ };
50
+ export default function hoistNonReactStatics<T extends OmniComponent, S extends OmniComponent, C extends ExcludeList = {}>(targetComponent: T, sourceComponent: S, excludelist?: C | undefined): T & NonReactStatics<S, C>;
51
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Hyphenates a camelcased CSS property name, for example:
3
+ *
4
+ * > hyphenateStyleName('backgroundColor')
5
+ * < "background-color"
6
+ * > hyphenateStyleName('MozTransition')
7
+ * < "-moz-transition"
8
+ * > hyphenateStyleName('msTransition')
9
+ * < "-ms-transition"
10
+ *
11
+ * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
12
+ * is converted to `-ms-`.
13
+ */
14
+ export default function hyphenateStyleName(string: string): string;
@@ -0,0 +1,2 @@
1
+ import { Interpolation } from '../types';
2
+ export default function interleave<Props extends object>(strings: readonly string[], interpolations: Interpolation<Props>[]): Interpolation<Props>[];
@@ -0,0 +1 @@
1
+ export default function isFunction(test: any): test is Function;
@@ -0,0 +1 @@
1
+ export default function isPlainObject(x: any): x is Record<any, any>;
@@ -0,0 +1 @@
1
+ export default function isStatelessFunction(test: any): test is Function;
@@ -0,0 +1,2 @@
1
+ import { RuleSet } from '../types';
2
+ export default function isStaticRules<Props extends object>(rules: RuleSet<Props>): boolean;
@@ -0,0 +1,2 @@
1
+ import { StyledComponentBrand } from '../types';
2
+ export default function isStyledComponent(target: any): target is StyledComponentBrand;
@@ -0,0 +1,2 @@
1
+ import { StyledTarget } from '../types';
2
+ export default function isTag(target: StyledTarget<'web'>): target is string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Convenience function for joining strings to form className chains
3
+ */
4
+ export declare function joinStrings(a?: string | undefined, b?: string | undefined): string;
5
+ export declare function joinStringArray(arr: string[], sep?: string | undefined): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Arrays & POJOs merged recursively, other objects and value types are overridden
3
+ * If target is not a POJO or an Array, it will get source properties injected via shallow merge
4
+ * Source objects applied left to right. Mutates & returns target. Similar to lodash merge.
5
+ */
6
+ export default function mixinDeep(target: any, ...sources: any[]): any;
@@ -0,0 +1 @@
1
+ export default function getNonce(): string | null;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * If the Object prototype is frozen, the "toString" property is non-writable. This means that any objects which inherit this property
3
+ * cannot have the property changed using a "=" assignment operator. If using strict mode, attempting that will cause an error. If not using
4
+ * strict mode, attempting that will be silently ignored.
5
+ *
6
+ * If the Object prototype is frozen, inherited non-writable properties can still be shadowed using one of two mechanisms:
7
+ *
8
+ * 1. ES6 class methods: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#methods
9
+ * 2. Using the `Object.defineProperty()` static method:
10
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty
11
+ *
12
+ * However, this project uses Babel to transpile ES6 classes, and transforms ES6 class methods to use the assignment operator instead:
13
+ * https://babeljs.io/docs/babel-plugin-transform-class-properties#options
14
+ *
15
+ * Therefore, the most compatible way to shadow the prototype's "toString" property is to define a new "toString" property on this object.
16
+ */
17
+ export declare function setToString(object: object, toStringFn: () => string): void;
@@ -0,0 +1,10 @@
1
+ import * as stylis from 'stylis';
2
+ import { Stringifier } from '../types';
3
+ export type ICreateStylisInstance = {
4
+ options?: {
5
+ namespace?: string | undefined;
6
+ prefix?: boolean | undefined;
7
+ } | undefined;
8
+ plugins?: stylis.Middleware[] | undefined;
9
+ };
10
+ export default function createStylisInstance({ options, plugins, }?: ICreateStylisInstance): Stringifier;
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "styled-components/native",
3
3
  "private": true,
4
- "types": "../dist/native/index.d.ts",
5
- "main": "../dist/styled-components.native.cjs.js",
6
- "jsnext:main": "../dist/styled-components.native.esm.js",
7
- "module": "../dist/styled-components.native.esm.js"
4
+ "types": "./dist/native/index.d.ts",
5
+ "main": "./dist/styled-components.native.cjs.js",
6
+ "jsnext:main": "./dist/styled-components.native.esm.js",
7
+ "module": "./dist/styled-components.native.esm.js"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styled-components",
3
- "version": "6.0.6-test.0",
3
+ "version": "6.0.7",
4
4
  "description": "CSS for the <Component> Age. Style components your way with speed, strong typing, and flexibility.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/styled-components.cjs.js",
@@ -10,33 +10,10 @@
10
10
  "./dist/styled-components.esm.js": "./dist/styled-components.browser.esm.js",
11
11
  "./dist/styled-components.cjs.js": "./dist/styled-components.browser.cjs.js"
12
12
  },
13
- "exports": {
14
- ".": {
15
- "types": "./dist/index.d.ts",
16
- "import": {
17
- "node": "./dist/styled-components.esm.js",
18
- "default": "./dist/styled-components.browser.esm.js"
19
- },
20
- "require": {
21
- "node": "./dist/styled-components.cjs.js",
22
- "default": "./dist/styled-components.browser.cjs.js"
23
- }
24
- },
25
- "./macro": {
26
- "types": "./dist/index.d.ts",
27
- "import": "./dist/styled-components-macro.esm.js",
28
- "require": "./dist/styled-components-macro.cjs.js"
29
- },
30
- "./native": {
31
- "types": "./dist/native/index.d.ts",
32
- "import": "./dist/styled-components.native.esm.js",
33
- "require": "./dist/styled-components.native.cjs.js"
34
- }
35
- },
36
13
  "sideEffects": false,
37
14
  "scripts": {
38
15
  "generateErrors": "node scripts/generateErrorMap.js",
39
- "prebuild": "rimraf dist native/dist && yarn generateErrors",
16
+ "prebuild": "rimraf dist && yarn generateErrors",
40
17
  "build": "rollup -c",
41
18
  "postbuild": "yarn size",
42
19
  "pretest": "yarn generateErrors",
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react");require("shallowequal");var n=require("stylis"),r=require("@emotion/unitless"),o=require("css-to-react-native"),s=require("postcss");function i(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var c=/*#__PURE__*/i(t),u=/*#__PURE__*/a(n),l=/*#__PURE__*/i(r),p=/*#__PURE__*/i(o),h=Object.freeze([]),f=Object.freeze({}),d="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function y(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,s=e.length;o<s;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function v(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(n.length>0?" Args: ".concat(n.join(", ")):"")):new Error(y.apply(void 0,e.__spreadArray([d[t]],n,!1)).trim())}function g(e,t){Object.defineProperty(e,"toString",{value:t})}var m="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",S="undefined"!=typeof window&&"HTMLElement"in window,_=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),w=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw v(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var i=this.indexOfGroup(e+1),a=(s=0,t.length);s<a;s++)this.tag.insertRule(i,t[s])&&(this.groupSizes[e]++,i++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+="".concat(this.tag.getRule(s)).concat("/*!sc*/\n");return t},e}(),E=new Map,b=new Map,P=1,A=function(e){if(E.has(e))return E.get(e);for(;b.has(P);)P++;var t=P++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>1073741824))throw v(16,"".concat(t));return E.set(e,t),b.set(t,e),t},C=function(e,t){E.set(e,t),b.set(t,e)},N="style[".concat(m,"][").concat("data-styled-version",'="').concat("6.0.6-test.0",'"]'),T=new RegExp("^".concat(m,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),O=function(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s<i;s++)(r=o[s])&&e.registerName(t,r)},D=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split("/*!sc*/\n"),o=[],s=0,i=r.length;s<i;s++){var a=r[s].trim();if(a){var c=a.match(T);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(C(l,u),O(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(a)}}},x=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(m))return r}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(m,"active"),r.setAttribute("data-styled-version","6.0.6-test.0");var i="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r},j=function(){function e(e){this.element=x(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}throw v(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),R=function(){function e(e){this.element=x(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),I=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),B=S,L={isServer:!S,useCSSOMInjection:!_},V=function(){function t(t,n,r){void 0===t&&(t=f),void 0===n&&(n={});var o=this;this.options=e.__assign(e.__assign({},L),t),this.gs=n,this.names=new Map(r),this.server=!!t.isServer,!this.server&&S&&B&&(B=!1,function(e){for(var t=document.querySelectorAll(N),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(m)&&(D(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this)),g(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return b.get(e)}(n);if(void 0===o)return"continue";var s=e.names.get(o),i=t.getGroup(n);if(void 0===s||0===i.length)return"continue";var a="".concat(m,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","))}),r+="".concat(i).concat(a,'{content:"').concat(c,'"}').concat("/*!sc*/\n")},s=0;s<n;s++)o(s);return r}(o)})}return t.registerId=function(e){return A(e)},t.prototype.reconstructWithOptions=function(n,r){return void 0===r&&(r=!0),new t(e.__assign(e.__assign({},this.options),n),this.gs,r&&this.names||void 0)},t.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new I(n):t?new j(n):new R(n)}(this.options),new w(e)));var e},t.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.prototype.registerName=function(e,t){if(A(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},t.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(A(e),n)},t.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.prototype.clearRules=function(e){this.getTag().clearGroup(A(e)),this.clearNames(e)},t.prototype.clearTag=function(){this.tag=void 0},t}(),z=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},k=/&/g,M=/^\s*\/\/.*$/gm;function $(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=$(e.children,t)),e})}var F=new V,q=function(e){var t,n,r,o=f.options,s=void 0===o?f:o,i=f.plugins,a=void 0===i?h:i,c=function(e,r,o){return o===n||o.startsWith(n)&&o.endsWith(n)&&o.replaceAll(n,"").length>0?".".concat(t):e},l=a.slice();l.push(function(e){e.type===u.RULESET&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(k,n).replace(r,c))}),s.prefix&&l.push(u.prefixer),l.push(u.stringify);var p=function(e,o,i,a){void 0===o&&(o=""),void 0===i&&(i=""),void 0===a&&(a="&"),t=a,n=o,r=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(M,""),p=u.compile(i||o?"".concat(i," ").concat(o," { ").concat(c," }"):c);s.namespace&&(p=$(p,s.namespace));var h=[];return u.serialize(p,u.middleware(l.concat(u.rulesheet(function(e){return h.push(e)})))),h};return p.hash=a.length?a.reduce(function(e,t){return t.name||v(15),z(e,t.name)},5381).toString():"",p}(),Y=(c.default.createContext({shouldForwardProp:void 0,styleSheet:F,stylis:q}),c.default.createContext(void 0),function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=q);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,g(this,function(){throw v(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=q),this.name+e.hash},e}());function G(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}var W=function(e){return e>="A"&&e<="Z"};function H(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;W(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}function U(e){return"function"==typeof e}function K(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Z(e){return"object"==typeof e&&"styledComponentId"in e}var J=function(e){return null==e||!1===e||""===e},Q=function(t){var n,r,o=[];for(var s in t){var i=t[s];t.hasOwnProperty(s)&&!J(i)&&(Array.isArray(i)&&i.isCss||U(i)?o.push("".concat(H(s),":"),i,";"):K(i)?o.push.apply(o,e.__spreadArray(e.__spreadArray(["".concat(s," {")],Q(i),!1),["}"],!1)):o.push("".concat(H(s),": ").concat((n=s,null==(r=i)||"boolean"==typeof r||""===r?"":"number"!=typeof r||0===r||n in l.default||n.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return o};function X(e,t,n,r){if(J(e))return[];if(Z(e))return[".".concat(e.styledComponentId)];if(U(e)){if(!U(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return[e];var o=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof o||Array.isArray(o)||o instanceof Y||K(o)||null===o||console.error("".concat(G(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),X(o,t,n,r)}var s;return e instanceof Y?n?(e.inject(n,r),[e.getName(r)]):[e]:K(e)?Q(e):Array.isArray(e)?Array.prototype.concat.apply(h,e.map(function(e){return X(e,t,n,r)})):[e.toString()]}function ee(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var te=function(e){return Object.assign(e,{isCss:!0})};function ne(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(U(t)||K(t)){var o=t;return te(X(ee(h,e.__spreadArray([o],n,!0))))}var s=t;return 0===n.length&&1===s.length&&"string"==typeof s[0]?X(s):te(X(ee(s,n)))}function re(t,n,r){if(void 0===r&&(r=f),!n)throw v(1,n);var o=function(o){for(var s=[],i=1;i<arguments.length;i++)s[i-1]=arguments[i];return t(n,r,ne.apply(void 0,e.__spreadArray([o],s,!1)))};return o.attrs=function(o){return re(t,n,e.__assign(e.__assign({},r),{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return re(t,n,e.__assign(e.__assign({},r),o))},o}var oe,se=c.default.createContext(void 0),ie=se.Consumer;function ae(e,t,n){return void 0===n&&(n=f),e.theme!==n.theme&&e.theme||t||n.theme}var ce="function"==typeof Symbol&&Symbol.for,ue=ce?Symbol.for("react.memo"):60115,le=ce?Symbol.for("react.forward_ref"):60112,pe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},he={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},fe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},de=((oe={})[le]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},oe[ue]=fe,oe);function ye(e){return("type"in(t=e)&&t.type.$$typeof)===ue?fe:"$$typeof"in e?de[e.$$typeof]:pe;var t}var ve=Object.defineProperty,ge=Object.getOwnPropertyNames,me=Object.getOwnPropertySymbols,Se=Object.getOwnPropertyDescriptor,_e=Object.getPrototypeOf,we=Object.prototype;function Ee(e,t,n){if("string"!=typeof t){if(we){var r=_e(t);r&&r!==we&&Ee(e,r,n)}var o=ge(t);me&&(o=o.concat(me(t)));for(var s=ye(e),i=ye(t),a=0;a<o.length;++a){var c=o[a];if(!(c in he||n&&n[c]||i&&c in i||s&&c in s)){var u=Se(t,c);try{ve(e,c,u)}catch(e){}}}}return e}var be=/(a)(d)/gi,Pe=function(e){return String.fromCharCode(e+(e>25?39:97))},Ae={};function Ce(e,t,n){if(void 0===n&&(n=!1),!n&&!K(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Ce(e[r],t[r]);else if(K(t))for(var r in t)e[r]=Ce(e[r],t[r]);return e}var Ne,Te,Oe=require("react-native"),De=(Ne=Oe.StyleSheet,Te=function(){function e(e){this.rules=e}return e.prototype.generateStyleObject=function(e){var t=function(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}(X(this.rules,e)),n=function(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Pe(t%52)+n;return(Pe(t%52)+n).replace(be,"$1-$2")}(z(5381,t)>>>0);if(!Ae[n]){var r=s.parse(t),o=[];r.each(function(e){"decl"===e.type?o.push([e.prop,e.value]):"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type ".concat(e.type," not supported as an inline style"))});var i=p.default(o),a=Ne.create({generated:i});Ae[n]=a.generated}return Ae[n]},e}(),function(n,r,o){var s=Z(n),i=n,a=r.displayName,u=void 0===a?function(e){return function(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}(e)?"styled.".concat(e):"Styled(".concat(G(e),")")}(n):a,l=r.attrs,p=void 0===l?h:l,d=s&&i.attrs?i.attrs.concat(p).filter(Boolean):p,y=r.shouldForwardProp;if(s&&i.shouldForwardProp){var v=i.shouldForwardProp;if(r.shouldForwardProp){var g=r.shouldForwardProp;y=function(e,t){return v(e,t)&&g(e,t)}}else y=v}var m=function(n,r){return function(n,r,o){var s=n.attrs,i=n.inlineStyle,a=n.defaultProps,u=n.shouldForwardProp,l=n.target,p=c.default.useContext(se),h=function(t,n,r){void 0===t&&(t=f);var o=e.__assign(e.__assign({},n),{theme:t}),s={};return r.forEach(function(e){var t,n=U(e)?e(o):e;for(t in n)o[t]=s[t]=n[t]}),[o,s]}(ae(r,p,a)||f,r,s),d=h[1],y=i.generateStyleObject(h[0]),v=o,g=d.as||r.as||l,m=d!==r?e.__assign(e.__assign({},r),d):r,S={};for(var _ in m)"$"!==_[0]&&"as"!==_&&("forwardedAs"===_?S.as=m[_]:u&&!u(_,g)||(S[_]=m[_]));return S.style=t.useMemo(function(){return U(r.style)?function(e){return[y].concat(r.style(e))}:r.style?[y].concat(r.style):y},[r.style,y]),S.ref=v,t.createElement(g,S)}(S,n,r)};"production"!==process.env.NODE_ENV&&(m.displayName=u);var S=c.default.forwardRef(m);return S.attrs=d,S.inlineStyle=new Te(s?i.inlineStyle.rules.concat(o):o),S.shouldForwardProp=y,"production"!==process.env.NODE_ENV&&(S.displayName=u),S.styledComponentId=!0,S.target=s?i.target:n,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=s?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)Ce(e,o[r],!0);return e}({},i.defaultProps,e):e}}),Ee(S,n,{attrs:!0,inlineStyle:!0,displayName:!0,shouldForwardProp:!0,target:!0}),S}),xe=function(e){return re(De,e)};["ActivityIndicator","Button","DatePickerIOS","DrawerLayoutAndroid","FlatList","Image","ImageBackground","KeyboardAvoidingView","Modal","Pressable","ProgressBarAndroid","ProgressViewIOS","RefreshControl","SafeAreaView","ScrollView","SectionList","Slider","Switch","Text","TextInput","TouchableHighlight","TouchableOpacity","View","VirtualizedList"].forEach(function(e){return Object.defineProperty(xe,e,{enumerable:!0,configurable:!1,get:function(){if(e in Oe&&Oe[e])return xe(Oe[e]);throw new Error("".concat(e," is not available in the currently-installed version of react-native"))}})}),exports.ThemeConsumer=ie,exports.ThemeContext=se,exports.ThemeProvider=function(n){var r=c.default.useContext(se),o=t.useMemo(function(){return function(t,n){if(!t)throw v(14);if(U(t)){var r=t(n);if("production"!==process.env.NODE_ENV&&(null===r||Array.isArray(r)||"object"!=typeof r))throw v(7);return r}if(Array.isArray(t)||"object"!=typeof t)throw v(8);return n?e.__assign(e.__assign({},n),t):t}(n.theme,r)},[n.theme,r]);return n.children?c.default.createElement(se.Provider,{value:o},n.children):null},exports.css=ne,exports.default=xe,exports.isStyledComponent=Z,exports.styled=xe,exports.useTheme=function(){var e=t.useContext(se);if(!e)throw v(18);return e},exports.withTheme=function(t){var n=c.default.forwardRef(function(n,r){var o=ae(n,c.default.useContext(se),t.defaultProps);return"production"!==process.env.NODE_ENV&&void 0===o&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'.concat(G(t),'"')),c.default.createElement(t,e.__assign({},n,{theme:o,ref:r}))});return"production"!==process.env.NODE_ENV&&(n.displayName="WithTheme(".concat(G(t),")")),Ee(n,t)};
2
- //# sourceMappingURL=styled-components.native.cjs.js.map