Skip to content

Commit

Permalink
Merge pull request #128 from VKCOM/SevereCloud/VKCOM/Switch
Browse files Browse the repository at this point in the history
feat(vkCom): add Switch
  • Loading branch information
8coon authored May 30, 2022
2 parents 6159546 + 8bb9896 commit 917240c
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 48 deletions.
96 changes: 48 additions & 48 deletions src/build/__snapshots__/snapthots.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -211351,11 +211351,11 @@ Object {
},
"compact": Object {
"name": "--vkui--size_switch_height--compact",
"value": "var(--vkui--size_switch_height--compact, 12px)",
"value": "var(--vkui--size_switch_height--compact, 10px)",
},
"regular": Object {
"name": "--vkui--size_switch_height--regular",
"value": "var(--vkui--size_switch_height--regular, 14px)",
"value": "var(--vkui--size_switch_height--regular, 10px)",
},
},
"sizeSwitchPin": Object {
Expand All @@ -211365,11 +211365,11 @@ Object {
},
"compact": Object {
"name": "--vkui--size_switch_pin--compact",
"value": "var(--vkui--size_switch_pin--compact, 18px)",
"value": "var(--vkui--size_switch_pin--compact, 16px)",
},
"regular": Object {
"name": "--vkui--size_switch_pin--regular",
"value": "var(--vkui--size_switch_pin--regular, 20px)",
"value": "var(--vkui--size_switch_pin--regular, 16px)",
},
},
"sizeSwitchWidth": Object {
Expand All @@ -211379,11 +211379,11 @@ Object {
},
"compact": Object {
"name": "--vkui--size_switch_width--compact",
"value": "var(--vkui--size_switch_width--compact, 32px)",
"value": "var(--vkui--size_switch_width--compact, 27px)",
},
"regular": Object {
"name": "--vkui--size_switch_width--regular",
"value": "var(--vkui--size_switch_width--regular, 34px)",
"value": "var(--vkui--size_switch_width--regular, 27px)",
},
},
"sizeTooltipMargin": Object {
Expand Down Expand Up @@ -212197,16 +212197,16 @@ Object {
"regular": "16px",
},
"sizeSwitchHeight": Object {
"compact": "12px",
"regular": "14px",
"compact": "10px",
"regular": "10px",
},
"sizeSwitchPin": Object {
"compact": "18px",
"regular": "20px",
"compact": "16px",
"regular": "16px",
},
"sizeSwitchWidth": Object {
"compact": "32px",
"regular": "34px",
"compact": "27px",
"regular": "27px",
},
"sizeTooltipMargin": Object {
"regular": "8px",
Expand Down Expand Up @@ -213003,16 +213003,16 @@ Object {
"regular": "var(--vkui--size_split_col_padding_horizontal--regular, 16px)",
},
"sizeSwitchHeight": Object {
"compact": "var(--vkui--size_switch_height--compact, 12px)",
"regular": "var(--vkui--size_switch_height--regular, 14px)",
"compact": "var(--vkui--size_switch_height--compact, 10px)",
"regular": "var(--vkui--size_switch_height--regular, 10px)",
},
"sizeSwitchPin": Object {
"compact": "var(--vkui--size_switch_pin--compact, 18px)",
"regular": "var(--vkui--size_switch_pin--regular, 20px)",
"compact": "var(--vkui--size_switch_pin--compact, 16px)",
"regular": "var(--vkui--size_switch_pin--regular, 16px)",
},
"sizeSwitchWidth": Object {
"compact": "var(--vkui--size_switch_width--compact, 32px)",
"regular": "var(--vkui--size_switch_width--regular, 34px)",
"compact": "var(--vkui--size_switch_width--compact, 27px)",
"regular": "var(--vkui--size_switch_width--regular, 27px)",
},
"sizeTooltipMargin": Object {
"regular": "var(--vkui--size_tooltip_margin--regular, 8px)",
Expand Down Expand Up @@ -213809,16 +213809,16 @@ Object {
"regular": 16,
},
"sizeSwitchHeight": Object {
"compact": 12,
"regular": 14,
"compact": 10,
"regular": 10,
},
"sizeSwitchPin": Object {
"compact": 18,
"regular": 20,
"compact": 16,
"regular": 16,
},
"sizeSwitchWidth": Object {
"compact": 32,
"regular": 34,
"compact": 27,
"regular": 27,
},
"sizeTooltipMargin": Object {
"regular": 8,
Expand Down Expand Up @@ -216525,11 +216525,11 @@ Object {
},
"compact": Object {
"name": "--vkui--size_switch_height--compact",
"value": "var(--vkui--size_switch_height--compact, 12px)",
"value": "var(--vkui--size_switch_height--compact, 10px)",
},
"regular": Object {
"name": "--vkui--size_switch_height--regular",
"value": "var(--vkui--size_switch_height--regular, 14px)",
"value": "var(--vkui--size_switch_height--regular, 10px)",
},
},
"sizeSwitchPin": Object {
Expand All @@ -216539,11 +216539,11 @@ Object {
},
"compact": Object {
"name": "--vkui--size_switch_pin--compact",
"value": "var(--vkui--size_switch_pin--compact, 18px)",
"value": "var(--vkui--size_switch_pin--compact, 16px)",
},
"regular": Object {
"name": "--vkui--size_switch_pin--regular",
"value": "var(--vkui--size_switch_pin--regular, 20px)",
"value": "var(--vkui--size_switch_pin--regular, 16px)",
},
},
"sizeSwitchWidth": Object {
Expand All @@ -216553,11 +216553,11 @@ Object {
},
"compact": Object {
"name": "--vkui--size_switch_width--compact",
"value": "var(--vkui--size_switch_width--compact, 32px)",
"value": "var(--vkui--size_switch_width--compact, 27px)",
},
"regular": Object {
"name": "--vkui--size_switch_width--regular",
"value": "var(--vkui--size_switch_width--regular, 34px)",
"value": "var(--vkui--size_switch_width--regular, 27px)",
},
},
"sizeTooltipMargin": Object {
Expand Down Expand Up @@ -217371,16 +217371,16 @@ Object {
"regular": "16px",
},
"sizeSwitchHeight": Object {
"compact": "12px",
"regular": "14px",
"compact": "10px",
"regular": "10px",
},
"sizeSwitchPin": Object {
"compact": "18px",
"regular": "20px",
"compact": "16px",
"regular": "16px",
},
"sizeSwitchWidth": Object {
"compact": "32px",
"regular": "34px",
"compact": "27px",
"regular": "27px",
},
"sizeTooltipMargin": Object {
"regular": "8px",
Expand Down Expand Up @@ -218177,16 +218177,16 @@ Object {
"regular": "var(--vkui--size_split_col_padding_horizontal--regular, 16px)",
},
"sizeSwitchHeight": Object {
"compact": "var(--vkui--size_switch_height--compact, 12px)",
"regular": "var(--vkui--size_switch_height--regular, 14px)",
"compact": "var(--vkui--size_switch_height--compact, 10px)",
"regular": "var(--vkui--size_switch_height--regular, 10px)",
},
"sizeSwitchPin": Object {
"compact": "var(--vkui--size_switch_pin--compact, 18px)",
"regular": "var(--vkui--size_switch_pin--regular, 20px)",
"compact": "var(--vkui--size_switch_pin--compact, 16px)",
"regular": "var(--vkui--size_switch_pin--regular, 16px)",
},
"sizeSwitchWidth": Object {
"compact": "var(--vkui--size_switch_width--compact, 32px)",
"regular": "var(--vkui--size_switch_width--regular, 34px)",
"compact": "var(--vkui--size_switch_width--compact, 27px)",
"regular": "var(--vkui--size_switch_width--regular, 27px)",
},
"sizeTooltipMargin": Object {
"regular": "var(--vkui--size_tooltip_margin--regular, 8px)",
Expand Down Expand Up @@ -218983,16 +218983,16 @@ Object {
"regular": 16,
},
"sizeSwitchHeight": Object {
"compact": 12,
"regular": 14,
"compact": 10,
"regular": 10,
},
"sizeSwitchPin": Object {
"compact": 18,
"regular": 20,
"compact": 16,
"regular": 16,
},
"sizeSwitchWidth": Object {
"compact": 32,
"regular": 34,
"compact": 27,
"regular": 27,
},
"sizeTooltipMargin": Object {
"regular": 8,
Expand Down
14 changes: 14 additions & 0 deletions src/themeDescriptions/themes/vkCom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ export const vkComTheme: ThemeVkComDescription = {
sizeBorderRadiusPaper: {
regular: 8,
},

// Компонент Switch
sizeSwitchHeight: {
regular: 10,
compact: 10,
},
sizeSwitchWidth: {
regular: 27,
compact: 27,
},
sizeSwitchPin: {
regular: 16,
compact: 16,
},
};

export const vkComThemeDark: ThemeVkComDarkDescription = {
Expand Down

0 comments on commit 917240c

Please sign in to comment.