@citygross/components 0.8.39 → 0.8.41

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.
@@ -22,5 +22,6 @@ export declare type TCgButton = {
22
22
  onClick?: () => void;
23
23
  fullWidth?: boolean;
24
24
  buttonRef?: React.Ref<HTMLButtonElement>;
25
+ round?: boolean;
25
26
  };
26
- export declare const CgButton: ({ size, variant, icon, flexReverse, disabled, onClick, children, loading, fullWidth, buttonRef }: TCgButton) => JSX.Element;
27
+ export declare const CgButton: ({ size, variant, icon, flexReverse, disabled, onClick, children, loading, fullWidth, buttonRef, round }: TCgButton) => JSX.Element;
@@ -8,6 +8,7 @@ export declare type TCgButtonStyleProps = {
8
8
  loading?: boolean;
9
9
  isIconOnly?: boolean;
10
10
  fullWidth?: boolean;
11
+ round?: boolean;
11
12
  };
12
13
  export declare const CgButtonContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, TCgButtonStyleProps, never>;
13
14
  export declare const CgButtonContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<TCgButtonStyleProps, "flexReverse" | "size" | "loading">, never>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare type TPill = {
3
+ active?: boolean;
4
+ amount?: number;
5
+ onClick: () => void;
6
+ text: string;
7
+ };
8
+ export declare const Pill: React.FunctionComponent<TPill>;
@@ -0,0 +1,7 @@
1
+ import { TPill } from './Pill';
2
+ declare type TActive = Pick<TPill, 'active'>;
3
+ export declare const PillComponent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TActive, never>;
4
+ export declare const PillContent: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const Text: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
6
+ export declare const Amount: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
7
+ export {};
@@ -25,8 +25,8 @@ exports.EButtonVariant = void 0;
25
25
  EButtonVariant[EButtonVariant["ghost"] = 4] = "ghost";
26
26
  })(exports.EButtonVariant || (exports.EButtonVariant = {}));
27
27
  var CgButton = function (_a) {
28
- var size = _a.size, variant = _a.variant, icon = _a.icon, flexReverse = _a.flexReverse, disabled = _a.disabled, onClick = _a.onClick, children = _a.children, loading = _a.loading, fullWidth = _a.fullWidth, buttonRef = _a.buttonRef;
29
- return (React__default["default"].createElement(CgButton_styles.CgButtonContainer, { ref: buttonRef, size: size, variant: variant, isIconOnly: !children, flexReverse: flexReverse, disabled: disabled || loading, fullWidth: fullWidth, loading: loading, onKeyDown: function (event) {
28
+ var size = _a.size, variant = _a.variant, icon = _a.icon, flexReverse = _a.flexReverse, disabled = _a.disabled, onClick = _a.onClick, children = _a.children, loading = _a.loading, fullWidth = _a.fullWidth, buttonRef = _a.buttonRef, round = _a.round;
29
+ return (React__default["default"].createElement(CgButton_styles.CgButtonContainer, { ref: buttonRef, round: round, size: size, variant: variant, isIconOnly: !children, flexReverse: flexReverse, disabled: disabled || loading, fullWidth: fullWidth, loading: loading, onKeyDown: function (event) {
30
30
  if (event.key === 'Enter') {
31
31
  onClick && onClick();
32
32
  }
@@ -46,12 +46,12 @@ var buttonShadow = function (size, variant) {
46
46
  return 'inset 0px -2px 0px rgba(0, 0, 0, 0.15)';
47
47
  }
48
48
  };
49
- var CgButtonContainer = styled__default["default"].button(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n ", "\n &:disabled {\n cursor: default;\n }\n &:after {\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n ", "\n"], ["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n ", "\n &:disabled {\n cursor: default;\n }\n &:after {\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n ", "\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
49
+ var CgButtonContainer = styled__default["default"].button(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n ", "\n &:disabled {\n cursor: default;\n }\n &:after {\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n ", "\n"], ["\n border-radius: ", "px;\n padding: ", ";\n cursor: pointer;\n outline: none;\n border: none;\n position: relative;\n ", "\n ", "\n &:disabled {\n cursor: default;\n }\n &:after {\n content: '';\n display: block;\n width: 100%;\n height: 100%;\n position: absolute;\n box-shadow: ", ";\n border-radius: ", "px;\n top: 0;\n left: 0;\n }\n\n ", "\n ", "\n"])), function (props) { var _a; return props.round ? '100' : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
50
50
  var _a;
51
51
  return props.isIconOnly
52
52
  ? "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, "px")
53
53
  : buttonPadding(props.size, props.theme.spacings);
54
- }, function (props) { return (props === null || props === void 0 ? void 0 : props.fullWidth) && "width: 100%;"; }, global_styles.focusVisible, function (props) { return buttonShadow(props.size, props.variant); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
54
+ }, function (props) { return (props === null || props === void 0 ? void 0 : props.fullWidth) && "width: 100%;"; }, global_styles.focusVisible, function (props) { return buttonShadow(props.size, props.variant); }, function (props) { var _a; return props.round ? '100' : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) {
55
55
  switch (props.variant) {
56
56
  case CgButton.EButtonVariant.primary:
57
57
  return CgPrimary;
@@ -18740,6 +18740,104 @@ var formatDateToLocale = function (date, withYear) {
18740
18740
  return (_b = (_a = moment(new Date(date))) === null || _a === void 0 ? void 0 : _a.format("dddd D MMMM ".concat(withYear ? 'YYYY' : ''))) === null || _b === void 0 ? void 0 : _b.toLocaleLowerCase();
18741
18741
  };
18742
18742
 
18743
+ var sv = {exports: {}};
18744
+
18745
+ sv.exports;
18746
+
18747
+ (function (module, exports) {
18748
+ (function (global, factory) {
18749
+ typeof commonjsRequire === 'function' ? factory(momentExports) :
18750
+ factory(global.moment);
18751
+ }(commonjsGlobal, (function (moment) {
18752
+ //! moment.js locale configuration
18753
+
18754
+ var sv = moment.defineLocale('sv', {
18755
+ months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split(
18756
+ '_'
18757
+ ),
18758
+ monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
18759
+ weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
18760
+ weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
18761
+ weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),
18762
+ longDateFormat: {
18763
+ LT: 'HH:mm',
18764
+ LTS: 'HH:mm:ss',
18765
+ L: 'YYYY-MM-DD',
18766
+ LL: 'D MMMM YYYY',
18767
+ LLL: 'D MMMM YYYY [kl.] HH:mm',
18768
+ LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',
18769
+ lll: 'D MMM YYYY HH:mm',
18770
+ llll: 'ddd D MMM YYYY HH:mm',
18771
+ },
18772
+ calendar: {
18773
+ sameDay: '[Idag] LT',
18774
+ nextDay: '[Imorgon] LT',
18775
+ lastDay: '[Igår] LT',
18776
+ nextWeek: '[På] dddd LT',
18777
+ lastWeek: '[I] dddd[s] LT',
18778
+ sameElse: 'L',
18779
+ },
18780
+ relativeTime: {
18781
+ future: 'om %s',
18782
+ past: 'för %s sedan',
18783
+ s: 'några sekunder',
18784
+ ss: '%d sekunder',
18785
+ m: 'en minut',
18786
+ mm: '%d minuter',
18787
+ h: 'en timme',
18788
+ hh: '%d timmar',
18789
+ d: 'en dag',
18790
+ dd: '%d dagar',
18791
+ M: 'en månad',
18792
+ MM: '%d månader',
18793
+ y: 'ett år',
18794
+ yy: '%d år',
18795
+ },
18796
+ dayOfMonthOrdinalParse: /\d{1,2}(\:e|\:a)/,
18797
+ ordinal: function (number) {
18798
+ var b = number % 10,
18799
+ output =
18800
+ ~~((number % 100) / 10) === 1
18801
+ ? ':e'
18802
+ : b === 1
18803
+ ? ':a'
18804
+ : b === 2
18805
+ ? ':a'
18806
+ : b === 3
18807
+ ? ':e'
18808
+ : ':e';
18809
+ return number + output;
18810
+ },
18811
+ week: {
18812
+ dow: 1, // Monday is the first day of the week.
18813
+ doy: 4, // The week that contains Jan 4th is the first week of the year.
18814
+ },
18815
+ });
18816
+
18817
+ return sv;
18818
+
18819
+ })));
18820
+ } (sv, sv.exports));
18821
+
18822
+ sv.exports;
18823
+
18824
+ moment.locale('sv');
18825
+ function getDateInfo(dateStr) {
18826
+ var date = moment(dateStr);
18827
+ return {
18828
+ day: {
18829
+ name: date.format('dddd'),
18830
+ number: date.format('DD')
18831
+ },
18832
+ isTomorrow: date.isSame(moment().add(1, 'day'), 'day'),
18833
+ month: {
18834
+ name: date.format('MMMM'),
18835
+ number: date.format('MM')
18836
+ },
18837
+ year: date.format('YYYY')
18838
+ };
18839
+ }
18840
+
18743
18841
  index.__exports.capitalizeFirstLetter = capitalizeFirstLetter;
18744
18842
  index.__exports.comparisonTypes = comparisonTypes;
18745
18843
  index.__exports.emailRegex = emailRegex;
@@ -18750,6 +18848,7 @@ index.__exports.formatPrice = formatPrice;
18750
18848
  index.__exports.formatPriceWithDecimalsReduced = formatPriceWithDecimalsReduced;
18751
18849
  index.__exports.formatPriceWithNoZero = formatPriceWithNoZero;
18752
18850
  index.__exports.getCountryFromLanguageCode = getCountryFromLanguageCode;
18851
+ index.__exports.getDateInfo = getDateInfo;
18753
18852
  index.__exports.languageCodeToCountryMap = languageCodeToCountryMap;
18754
18853
  index.__exports.makeCateringPortionsString = makeCateringPortionsString;
18755
18854
  index.__exports.moment = moment;